mapbox / shp-write

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

Name headers are truncated #74

Closed macsee closed 10 months ago

macsee commented 5 years ago

Hi, I've a data set with name headers that are truncated to 8 chars length, however, the body data is displayed correctly. Is there any way to output more than 8 chars in headers, just like in body? Thanks!

Cheers, Maxi

dioslibre commented 4 years ago

No. It's a limitation of the DBF file format unfortunately. See this https://support.esri.com/en/technical-article/000007920

davidbeers commented 4 years ago

I have the same problem. The doc on the DBF file format says the limitation is 10 characters, but shp-write truncates field names to 8 characters.

davidbeers commented 4 years ago

It looks like this is a bug already reported in the mapbox/dbf package: https://github.com/mapbox/dbf/issues/11

srikanth0526 commented 1 year ago

Search for this line in the library js file f.name.split('').slice(0, 8) and replace 8 with 10. Then I could able to see the 10 character name in the shape file.

Too simple right !!!

sheindel commented 1 year ago

This is now fixed in dbf 0.2.0 and we hope to upgrade to that library revision change to this repo soon.

sheindel commented 10 months ago

Good news: v0.4.2 is now available with this fix from dbf.

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