Closed helxsz closed 3 months ago
Related question: https://stackoverflow.com/q/78659655/8816585
if the uploaded file ends in .shp
it's a shapefile not a zipfile so you need to pass it to parseShp which you can import via import {parseShp} from 'shpjs'
or it may be available as shp.parseShp
.
Note that won't handle the projection or the dbf file, if that's the case you'll want allow them to upload all the files need and then pass it to the advanced api
actually in the new version I'm about to publish you should be able to pass shp({shp: await file.raw.arrayBuffer()})
and get a property-less shapefile
I am working with vue3 to load a shp file as shown below, this shp file can work out in other shapefile based software
await file.raw.arrayBuffer() outputs
ArrayBuffer(59664156) byteLength: 59664156
but shp(await file.raw.arrayBuffer()); throws out an error
shpjs 's version is "^5.0.1".