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

libproj: fix longtitude estimation for PJ_AREA #2476

Merged
merged 1 commit into from
Jul 3, 2022
Merged

Conversation

metzm
Copy link
Contributor

@metzm metzm commented Jul 1, 2022

PROJ likes to have longitudes in the range [-180, 180] which causes problems with geometries crossing the anti-meridian at either -180 or 180, also with the PROJ-specific PJ_AREA object required by PROJ to select the correct PROJ pipeline(s).

Tests with areas crossing the antimeridian and reprojecting these to UTM zone 60 or UTM zone 1 were successful. However, reprojecting back to a latlong location does not work out of the box. The user has to manually add the PROJ +over switch to the transformation pipeline, e.g.

+proj=pipeline +step +inv +proj=utm +zone=1 +south +ellps=WGS84 +over +step +proj=unitconvert +xy_in=rad +xy_out=deg

to successfully reproject an area back from UTM zone 1 to latlong: round trip latlong - > UTM zone -> latlong.

Unfortunately, there is no straightforward way (also not in the PROJ API) to automatically inject the +over switch at the correct place(s) in a PROJ projection pipeline.

@metzm metzm added bug Something isn't working backport_needed C Related code is in C labels Jul 1, 2022
@metzm metzm added this to the 8.2.1 milestone Jul 1, 2022
@metzm metzm merged commit d0b904f into OSGeo:main Jul 3, 2022
@metzm metzm deleted the libproj_area branch July 3, 2022 19:59
metzm added a commit that referenced this pull request Jul 3, 2022
This is a partial fix for reprojections across the anti-meridian, where crossing 180W or 180E need to be handled differently, depending on the involved CRS's.
metzm added a commit that referenced this pull request Jul 3, 2022
This is a partial fix for reprojections across the anti-meridian, where crossing 180W or 180E need to be handled differently, depending on the involved CRS's.
metzm added a commit that referenced this pull request Jul 3, 2022
This is a partial fix for reprojections across the anti-meridian, where crossing 180W or 180E need to be handled differently, depending on the involved CRS's.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
This is a partial fix for reprojections across the anti-meridian, where crossing 180W or 180E need to be handled differently, depending on the involved CRS's.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
This is a partial fix for reprojections across the anti-meridian, where crossing 180W or 180E need to be handled differently, depending on the involved CRS's.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
This is a partial fix for reprojections across the anti-meridian, where crossing 180W or 180E need to be handled differently, depending on the involved CRS's.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C Related code is in C
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants