(self, i=None)
Returns the offset in a .shp file for a shape based on information
		in the .shx index file.
Returns the offset in a .shp file for a shape based on information
		in the .shx index file.
Returns the offset in a . shp file for a shape based on information in the . shx index file .
def __shapeIndex(self, i=None):
		"""Returns the offset in a .shp file for a shape based on information
		in the .shx index file."""
		f = self.__getFileObj(self.shx)
		if not f:
			return None
		if not self._offsets:
			# File length (16-bit word * 2 = bytes) - header length
			f.seek(24)
			shxRecordLength = (unpack(">i", f.read(4))[0] * 2) - 100
			numRecords = shxRecordLength / 8
			# Jump to the first record.
			f.seek(100)
			for r in range(numRecords):
				# Offsets are 16-bit words just like the file length
				self._offsets.append(unpack(">i", f.read(4))[0] * 2)
				f.seek(f.tell() + 4)
		if i:
			return self._offsets[i]
def __shapeIndex ( self , i = None ) : f = self . __getFileObj ( self . shx ) if not f : return None if not self . _offsets : # File length (16-bit word * 2 = bytes) - header length f . seek ( 24 ) shxRecordLength = ( unpack ( ">i" , f . read ( 4 ) ) [ 0 ] * 2 ) - 100 numRecords = shxRecordLength / 8 # Jump to the first record. f . seek ( 100 ) for r in range ( numRecords ) : # Offsets are 16-bit words just like the file length self . _offsets . append ( unpack ( ">i" , f . read ( 4 ) ) [ 0 ] * 2 ) f . seek ( f . tell ( ) + 4 ) if i : return self . _offsets [ i ]