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

Does to_wkt use PROJ version to determine WKT version to use? #604

Closed
djhoese opened this issue Apr 16, 2020 · 5 comments
Closed

Does to_wkt use PROJ version to determine WKT version to use? #604

djhoese opened this issue Apr 16, 2020 · 5 comments
Labels

Comments

@djhoese
Copy link
Contributor

djhoese commented Apr 16, 2020

I'm in the process of converting the pyresample project to use WKT internally by calling CRS.to_wkt(). We've had issues in the past with other projects where we would pass pyproj.CRS.to_wkt() to rasterio's CRS object. Rasterio seemed to depend on the version of GDAL installed (GDAL 3 -> WKT2 supported, otherwise WKT1). So I'm wondering, does pyproj's support of WKT2 depend on the version of PROJ? Is there ever a chance for a user to install current pyproj with an old-ish PROJ and get errors when to_wkt tries to convert to WKT2?

@snowman2
Copy link
Member

@djhoese
Copy link
Contributor Author

djhoese commented Apr 16, 2020

Perfect! Thank you. That helps a lot. However, I couldn't find the answer I specifically wanted but I may just be missing an explicit answer on that page or have a misunderstanding of pyproj. If I do:

pyproj.CRS.from_user_input(some_input).to_wkt()

Is there ever a case where I could have a version of pyproj with those methods where to_wkt defaults to WKT2 where it would then fail (exception) because WKT2 isn't supported by the installed version of PROJ. Put another way, what library does the WKT conversion in pyproj? Is it coded in pyproj or does it come from PROJ? Does the minimum version of PROJ required by pyproj support WKT2 so this could never happen?

@snowman2
Copy link
Member

If you have pyproj >= 2 it should always support WKT2.

@snowman2
Copy link
Member

Is it coded in pyproj or does it come from PROJ?

It comes from PROJ

Does the minimum version of PROJ required by pyproj support WKT2 so this could never
happen?

Correct

@djhoese
Copy link
Contributor Author

djhoese commented Apr 16, 2020

Great.pyproj >= 2.3 is probably what pyresample will require so this looks good. Thanks again.

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

No branches or pull requests

2 participants