Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproject output to EPSG:4326 by default. #50

Closed
stevage opened this issue Aug 10, 2018 · 1 comment
Closed

Reproject output to EPSG:4326 by default. #50

stevage opened this issue Aug 10, 2018 · 1 comment

Comments

@stevage
Copy link

stevage commented Aug 10, 2018

I really love shp2json (and avoiding the massive dependency that is GDAL), but the fact it doesn't support reprojection is often a pain. (Particularly when you write a script that assumes that all your shapefiles will be EPSG:4326, then one arrives in a different projection and now you have to switch to OGR2OGR or something.)

Mike addressed the issue, saying " This is just a Shapefile parser, so it wouldn’t be the right place to implement coordinate system transformations."

I would like to argue against this :)

First, it's not just a Shapefile parser. shp2json is clearly a Shapefile->Geojson converter. And currently, it's producing GeoJSON that doesn't comply with the RFC. If a library or tool is producing GeoJSON as output, it should produce that GeoJSON in EPSG:4326 by default (and maybe allow retaining the original projection with some special flag).

Secondly, it definitely seems like the job of this library to parse the .prj file if there is one, at least.

Sure, it's possible to use workarounds to get around this limitation, but they're not convenient, particularly when you're dealing with a Shapefile whose projection you don't know ahead of time. That makes this kind of command line hard to write:

shp2json foo.shp | reproject --to=EPSG:4326 --from=...what?

(Supporting reprojection to arbitrary CRS's would definitely be beyond the scope of the library, otoh.)

@mbostock
Copy link
Owner

I’m not adding reprojection to this library. That would be a significant undertaking and I want this library to be small. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants