Incorrect header of shx file
Rulexec opened this issue · comments
Currently .shx file uses the same header as .shp. They should be the same, except file length field.
So, some tools cannot read it correctly:
$ ogrinfo test.shp
ERROR 4: Failed to read all values for 3 records in .shx file.
ERROR 4: Failed to read all values for 3 records in .shx file.
FAILURE:
Unable to open datasource `test.shp' with the following drivers.
please use this package cloudv-node-shapefile instead of ginkgoch/node-shapefile;
I download it, fix this bug, and publish a new One, the problem is in shp.ts
the _push
method, it only update the shpHeader correctly and make a copy as the shxHeader, however shxHeader's fileLength is not the same as shpHeader, so the problem occurs. cloudv-node-shapefile fixes that.