calvinmetcalf / shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
http://calvinmetcalf.github.io/shapefile-js/
715 stars 228 forks source link

Convert shapefile from CRS other than wgs84 to wgs84 #138

Closed ClassicSours closed 2 years ago

ClassicSours commented 3 years ago

Hey,

I have a shapefile in NAD27 and can see the shape file just fine at https://mapshaper.org/ however when I run it through parseZip it produces a shapefile, but the data in it is useless.

The first Feature for example "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [2041379.3437514722, 12680884.8], [2041641.678816773, 12681121.910500074], ...

But when run through shpjs.parseZip

"type": "Feature", "geometry": { "bbox": [0, 90, 0, 90], "type": "LineString", "coordinates": [ [0,90], [0,90], [0, 90], [0,90] ...

Expected Geometry: image

Actual Geometry is nothing.

calvinmetcalf commented 3 years ago

i think this is actually an issue with one of our dependencies, proj4js which handles the conversion, specifically it doens't like the prj definition, I'll open an issue there