mapbox / shp-write

create and write to shapefiles in pure javascript
BSD 3-Clause "New" or "Revised" License
292 stars 186 forks source link

Poly Write #21

Closed sainsb closed 8 years ago

sainsb commented 9 years ago

Rather than issue a pull request, I'm logging this as an issue. with a solution.

https://github.com/mapbox/shp-write/blob/master/src/poly.js#L43 shpI += contentLength;

should be:

shpI += contentLength +8;

Note that this affects GeoJSON.io as well. Multiple polygons to shapefile == fail until this fix is implemented.

Oh Yeah, this one too: https://github.com/mapbox/shp-write/blob/master/src/poly.js#L25

shxOffset += contentLength;

should be:

shxOffset += contentLength+8;

many Bothans died ....

jfgodoy commented 9 years ago

same issue here. I applied the changes that @sainsb said and works well.

tmcw commented 8 years ago

Fixed in #23