mapbox / shp-write

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

Error while using shp-write at nodeJs server side to convert GeoJson to Shp file #93

Open syncthreads-sammith opened 1 year ago

syncthreads-sammith commented 1 year ago

can shp-write be able to run at NodeJs server environment ,if yes can we use the way they mention in documentation i refer this documentation this throws error Screenshot 2023-08-05 110329 below is the format of GeoJson I'm using const goeJson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [-73.985791, 40.748817], [-73.985852, 40.748192], [-73.985424, 40.748176], [-73.985363, 40.748801], [-73.985791, 40.748817] ] ] }, "properties": { "name": "Polygon Feature 1", "description": "This is the first polygon feature." } } ] } i dont understand what part of code is wrong, i have tried with multiple version of shp-write shp-write and shp-write-update no use how do we convert geoJson to shp file format ?

sheindel commented 1 year ago

Have you tried this with our latest release v0.4.2?

Mapbox changed their deployment organization so this package is now hosted under a different package

@mapbox/shp-write (on NPM)

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