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
Export as WKT1_ESRI or WKT1_GDAL silently returns None for custom CRS #1036
Comments
I just realised that the same happens when trying to export to WKT1_GDAL as well. |
The I am seeing that the typing/docstring should be updated for the To get error more descriptive information from PROJ, see: |
Shouldn't |
Runtime warnings sound like they could be useful. Is this something you are interested in implementing? |
I can make a PR for that, yes. Are there any other methods with the same behaviour that should be treated in the same way? |
The main one to be concerned about is Thanks 👍 |
Personally I wouldn't necessarily expect |
I was thinking about this last night and had the exact same thoughts as @jorisvandenbossche. Here is an example: I am starting to think that a warning only on |
For |
While you can reasonably expect
I agree with this but that should be probably done with a deprecation period if we decide to go that way. |
For end users, the warning indeed doesn't hurt. But for library users like the example that @snowman2 gave above (https://github.com/opendatacube/odc-geo/blob/d1e45e366a511cf690d36155daccac73241e52eb/odc/geo/crs.py#L34-L38, and we do something similar in pyogrio), that would mean they would need to start catching such warning. |
Then the question is who want pyproj primarily serve. If an end user, then I'd keep the warning. If it is meant to be low-level library primarily consumed by others, hence serving developers, then let's remove it. I think that it is somewhere in between now, esp. in a way in which it is used in geopandas, where we use it internally but expose the I am happy with whatever @snowman2 prefers here. |
pyproj is used by users and libraries and both are equal in importance. As demonstrated by Since this issue is focused on WKT and we have consensus that a warning/error should be raised when it is None, I propose we focus the discussion on Current proposed solution for
I am thinking that this pattern would also be good to follow to What do y'all think? |
That sounds good. I'll adapt #1037 accordingly. |
Code Sample, a copy-pastable example if possible
Problem description
Export of the custom CRS used above to WKT using
version="WKT1_ESRI"
returns None. My assumption is that the CRS cannot be expressed as WKT1_ESRI but pyproj does not raise or warn about it but happily returnsNone
instead. The CRS is coming from geopandas/geopandas#2387.Expected Output
I would expect this to raise or give me some sort of indication that the export did not happen.
Environment Information
Installation method
Conda environment information (if you installed with conda):
Environment (
conda list
):Details about
conda
and system (conda info
):The text was updated successfully, but these errors were encountered: