calvinmetcalf / shapefile-js

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

the prj will crash the read if it has something that is not valid #131

Closed kagoentzel closed 2 years ago

kagoentzel commented 3 years ago

Add the following code the proj4 read section(s) to resolve. Im defaulting it to WGS84 in project locally

try{ zip[key] = proj4(zip[key]); }catch(e){ zip[key] = proj4('GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]'); }