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

WKT -> PROJJSON #1

Open
kylebarron opened this issue Jun 23, 2022 · 1 comment
Open

WKT -> PROJJSON #1

kylebarron opened this issue Jun 23, 2022 · 1 comment

Comments

@kylebarron
Copy link

kylebarron commented Jun 23, 2022

👋 Hi Even, awesome work on this.

I've been looking through the code and thinking about trying to write an implementation that converts from WKT to PROJJSON. I think a pure-Python example of this could partly assuage some PROJJSON interoperability concerns, e.g. in geoarrow/geoarrow#8 (comment).

My thinking is that I'd implement a WKT parser (prior pure-Python art here https://github.com/karimbahgat/PyCRS/blob/master/pycrs/parse.py#L136-L423) and then attempt to follow your code for the inverse mapping of tags from WKT into PROJJSON (probably first starting just with WKT2 and then maybe later with WKT1).

Would you be interested in a PR to this repo? Or would you prefer to keep this repo minimal with just PROJJSON -> WKT?

@rouault
Copy link
Owner

rouault commented Jun 23, 2022

Would you be interested in a PR to this repo?

make sense.

Note that the PROJJSON -> WKT1 in the existing code is more a toy than something actually useful. It produces syntaxically valid WKT1, but the issue is that real interoperability comes with projection method and parameter names, datum names, etc. and traditionnaly WKT1 in GDAL <= 2.4 uses quite different names from the one of WKT2 with latest EPSG database, and this more or less requires a full PROJ implementation to do those non-trivial morphing. So you'd better restricting your scope to WKT2:2019 -> PROJJSON.

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