We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efafff8 commit 4c0b9b4Copy full SHA for 4c0b9b4
shapefile.py
@@ -389,12 +389,10 @@ def __shapeIndex(self, i=None):
389
numRecords = shxRecordLength // 8
390
# Jump to the first record.
391
shx.seek(100)
392
+ shxRecords = array.array('i', unpack(">" + "i4x" * numRecords,
393
+ shx.read((4+4) * numRecords)))
394
# Offsets are 16-bit words just like the file length
- self._offsets = [2*el for el in
- array.array('i', unpack(">%si" % (numRecords*2),
395
- shx.read(4 * numRecords*2))
396
- )[::2]
397
- ]
+ self._offsets = [2*el for el in shxRecords]
398
if not i == None:
399
return self._offsets[i]
400
0 commit comments