calvinmetcalf / shapefile-js

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

Projection question #65

Closed vajnorcan closed 7 years ago

vajnorcan commented 8 years ago

First of all, thanks for this stuff it's amazing!

I do have a question however, why when I provide a zip file which contains all the shape files (even prj) are all the features transformed to WGS. Is there any parameter I could provide to shp(buffer, ?) that would avoid reprojecting?

I could identify this line of code: if (typeof toProj === 'undefined') { toProj = fromProj; fromProj = wgs84; single = true; }

So if I comment in the "fromProj = wgs84" then it will work as expected, but I'm curious whether there is any parameterized way to control this.

Also, I've noticed that the PROJ4 library is already embedded in shp.js/shp.min.js. I alredy have the amd repository for a standalone proj4 module. Any chance that you would split up the code so the proj4 would be optional?

Thank you

calvinmetcalf commented 8 years ago

the aim of this library is to just work for 80%+ of all use cases non wgs84 is not in that 80%. That being said there are a couple things you could do