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 8f671db commit efafff8Copy full SHA for efafff8
shapefile.py
@@ -390,7 +390,11 @@ def __shapeIndex(self, i=None):
390
# Jump to the first record.
391
shx.seek(100)
392
# Offsets are 16-bit words just like the file length
393
- self._offsets = [unpack('>i4x', shx.read(8))[0] * 2 for r in range(numRecords)]
+ self._offsets = [2*el for el in
394
+ array.array('i', unpack(">%si" % (numRecords*2),
395
+ shx.read(4 * numRecords*2))
396
+ )[::2]
397
+ ]
398
if not i == None:
399
return self._offsets[i]
400
0 commit comments