mapbox / shp-write

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

Different number of records in .shp and .dbf files #67

Closed Renaud009 closed 10 months ago

Renaud009 commented 5 years ago

Providing two polygons Features to method shpwrite.download() with following GeoJSON and an empty options object:

{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-11163474.973548545,7228699.2719911495],[-10869956.784933466,8158173.5359388925],[-9989402.219088236,6984100.781478586],[-10703629.811384924,5604565.294987724],[-11848350.746983724,5761108.3289157655],[-11163474.973548545,7228699.2719911495]]]},"properties":{"name":"feature_1","description":"","type":"Polygon"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-10772117.388728442,10163881.158141918],[-11271098.309374074,11015083.90512564],[-12122301.056357795,10516102.984480008],[-11623320.135712164,9664900.237496287],[-10772117.388728442,10163881.158141918]]]},"properties":{"name":"feature_2","description":"","type":"Square"}}]}

Then when loading shapefile with https://mapshaper.org/ I get this error "Different number of records in .shp and .dbf files". Can anyone help me?

Thanks

hwbllmnn commented 5 years ago

Perhaps #65 will fix your problem. For point geometries I had a simiar issue, which is fixed with #69. You can also check out https://github.com/hwbllmnn/shp-write/tree/maintenance which contains both fixes.

sheindel commented 10 months ago

Good news: v0.4.2 is now available, which I believe resolves this issue.

Less good news: Mapbox changed their deployment organization so this package is now hosted under a different package

@mapbox/shp-write https://unpkg.com/@mapbox/shp-write@latest/shpwrite.js