original_docstring: Reads the header information from a .shp or .shx file.
docstring: Reads the header information from a .shp or .shx file.
docstring_tokens: Reads the header information from a . shp or . shx file .
code: def __shpHeader(self):
          """Reads the header information from a .shp or .shx file."""
          if not self.shp:
              raise ShapefileException("Shapefile Reader requires a shapefile or file-like object. (no shp file found")
          shp = self.shp
          # File length (16-bit word * 2 = bytes)
          shp.seek(24)
          self.shpLength = unpack(">i", shp.read(4))[0] * 2
          # Shape type
          shp.seek(32)
          self.shapeType= unpack("<i", shp.read(4))[0]
          # The shapefile's bounding box (lower left, upper right)
          self.bbox = _Array('d', unpack("<4d", shp.read(32)))
          # Elevation
          self.zbox = _Array('d', unpack("<2d", shp.read(16)))
          # Measure
          self.mbox = []
          for m in _Array('d', unpack("<2d", shp.read(16))):
              # Measure values less than -10e38 are nodata values according to the spec
              if m > NODATA:
                  self.mbox.append(m)
              else:
                  self.mbox.append(None)
code_tokens: def __shpHeader ( self ) : if not self . shp : raise ShapefileException ( "Shapefile Reader requires a shapefile or file-like object. (no shp file found" ) shp = self . shp shp . seek ( 24 ) self . shpLength = unpack ( ">i" , shp . read ( 4 ) ) [ 0 ] * 2 shp . seek ( 32 ) self . shapeType = unpack ( "<i" , shp . read ( 4 ) ) [ 0 ] self . bbox = _Array ( 'd' , unpack ( "<4d" , shp . read ( 32 ) ) ) self . zbox = _Array ( 'd' , unpack ( "<2d" , shp . read ( 16 ) ) ) self . mbox = [ ] for m in _Array ( 'd' , unpack ( "<2d" , shp . read ( 16 ) ) ) : if m > NODATA : self . mbox . append ( m ) else : self . mbox . append ( None )
short_docstring: Reads the header information from a .shp or .shx file.
short_docstring_tokens: Reads the header information from a . shp or . shx file .
comment: """Reads the header information from a .shp or .shx file."""$SEP$# File length (16-bit word * 2 = bytes)
  $SEP$# Shape type
  $SEP$# The shapefile's bounding box (lower left, upper right)
  $SEP$# Elevation
  $SEP$# Measure
  $SEP$# Measure values less than -10e38 are nodata values according to the spec
  