-
Notifications
You must be signed in to change notification settings - Fork 216
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
DOC: Converting from fiona CRS to pyproj.crs.CRS #1360
Comments
@idanmiara Do you have a suggestion of how it should be reworded/updated? Would you be comfortable making a pull request for this? If not, maybe you could post a comment here with the content you want in that section and one of the pyproj maintainers could make the PR. |
Hi @djhoese
output:
|
In [1]: from pyproj import CRS
In [2]: from fiona.crs import CRS as fCRS
In [3]: crs = CRS(4326)
In [4]: fCRS.from_wkt(crs.to_wkt())
Out[4]: CRS.from_epsg(4326)
In [5]: fCRS.from_proj4(crs.to_proj4())
/home/davidh/miniconda3/envs/satpy_py311_2/lib/python3.11/site-packages/pyproj/crs/crs.py:1293: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
proj = self._crs.to_proj4(version=version)
Out[5]: CRS.from_epsg(4326) |
With Fiona 1.9+ and GDAL 3+, the instructions should look similar to rasterio: https://pyproj4.github.io/pyproj/stable/crs_compatibility.html#rasterio |
In the rio example you take a rio wkt and pass it to pyproj:
which works fine. |
@idanmiara Could you explain what I'm doing differently in my comment above where I do as you suggest and it works for me? |
Thanks @djhoese, I've must have missed your comment before. |
I was struggling with finding the best way to convert between fiona CRS and pyproj CRS.
I think that the section
https://pyproj4.github.io/pyproj/dev/crs_compatibility.html#converting-from-fiona-crs-to-pyproj-crs-crs
needs to be updated with regards to
Toblerity/Fiona#714
Also,
dc_crs
is undefined:https://pyproj4.github.io/pyproj/dev/crs_compatibility.html#converting-from-pyproj-crs-crs-for-fiona
https://pyproj4.github.io/pyproj/dev/crs_compatibility.html#preparing-pyproj-crs-crs-for-geopandas
The text was updated successfully, but these errors were encountered: