You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
(Supporting reprojection to arbitrary CRS's would definitely be beyond the scope of the library, otoh.)
The text was updated successfully, but these errors were encountered: