Switch to pyproj 2.3+ for Transformer and CRS objects
@pnuu is already working on this.
Since Apr 13, 2020.
- Dominant language
- Python
- Stars
- 385
- Forks
- 102
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
Background
Pyresample has used old pyproj interfaces for a long time and depends heavily on the Proj class to transform between lon/lat degree coordinates and X/Y projection coordinates. We also depend heavily on PROJ parameter dictionaries and strings. PROJ strings are overall deprecated and are unable of representing all Coordinate Reference Systems (CRS) out there. The PROJ library suggests WellKnownText (WKT).
Forgive me for the lack of references to the claims in this issue.
Suggestions
-
Drop the custom
Projclasses in:These checks are meant to produce lon/lat degrees when dealing with a geographic CRS (
+proj=latlong). As of pyproj 2.3.0 this is done by default. This current check also makes it so certain geographic CRSes are not possible (ex.+proj=latlong +pm=180). -
Switch to the pyproj
Transformerclass for all currentProjuses. It is the recommended interface and would go something like this (I think):from pyproj import Transformer, CRS t = Transformer.from_crs(CRS('EPSG:4326'), area_def.crs, always_xy=True) x, y = t.transform(lon, lat)Without the
always_xy=Truethis would flip the expected/returned order of the axes. In the case of EPSG:4326, this expects latitude first, longitude second. -
Drop PROJ parameters as internally stored representation of CRS information. See #264 for first attempts at storing WKT instead.
CC @snowman2 (pyproj maintainer). If you have any other suggestions, corrections, or other feedback, please let us know.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.