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

createOperation(): make sure no to discard deprecated operations... #2622

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

rouault
Copy link
Member

@rouault rouault commented Mar 28, 2021

if the replacement uses a grid unknown to us.

Fixes issue reported at https://lists.osgeo.org/pipermail/gdal-dev/2021-March/053771.html

The issue comes from the fact that EPSG has created 2 transformations
using grids BALR2009.gsb ad PENR2009.gsb that supersede the one which
uses the single grid SPED2ETV2 we have in PROJ-data.

More general fix than the hack of #2619

if the replacement uses a grid unknown to us.

Fixes issue reported at https://lists.osgeo.org/pipermail/gdal-dev/2021-March/053771.html

The issue comes from the fact that EPSG has created 2 transformations
using grids BALR2009.gsb ad PENR2009.gsb that supersede the one which
uses the single grid SPED2ETV2 we have in PROJ-data.
@rouault rouault force-pushed the fix_sped2etv2_supersession branch from 712a3ec to b7f9a9b Compare March 28, 2021 21:42
@jjimenezshaw
Copy link
Contributor

jjimenezshaw commented Mar 28, 2021

The "new" grids are in https://www.ign.es/web/ign/portal/gds-rejilla-cambio-datum (that are not new. They just updated in EPSG what was in their page for a long time)
However, I guess that the data in es_ign_SPED2ETV2.tif is the same, combining both files BALR2009.gsb and PENR2009.gsb in one, with two subdatasets.

The "problem" is that PENR2009.gsb covers the Balearic Islands, but with un-precise values. The file BALR2009.gsb has more accurate data for the Balearic Islands.

@jjimenezshaw
Copy link
Contributor

Due to this unfortunate overlap of both files in the Balearic Islands, with different data, I do not know what is going to do PROJ if we define two different gridfiles.

@rouault
Copy link
Member Author

rouault commented Mar 28, 2021

The "problem" is that PENR2009.gsb covers the Balearic Islands, but with un-precise values. The file BALR2009.gsb has more accurate data for the Balearic Islands.

yes, that was addressed per OSGeo/PROJ-data#32
It would probably be cleaner to add the 2 separate grids in PROJ-data and register them in grid_alternatives. That way users would have the choice to select which grid is the most appropriate.

@jjimenezshaw
Copy link
Contributor

jjimenezshaw commented Mar 28, 2021

That way users would have the choice to select which grid is the most appropriate.

I think user will not notice that. They will just let PROJ to select what PROJ considers better (even more from GDAL, as in the source problem). Right now, PROJ is doing what IGN says: use BALR2009.gsb for the islands, and PENR2009.gsb for the mainland (except a really tiny area in the coast). I guess that if we split, PROJ will use always PENR2009.gsb because it is bigger, right?

@rouault
Copy link
Member Author

rouault commented Mar 28, 2021

I guess that if we split, PROJ will use always PENR2009.gsb because it is bigger, right?

hum, good question. The algorithm is deterministic, but I have not in mind what would happen in that situation. Actually trying "projinfo -s ED50 -t ETRS89 --summary --spatial-test intersects --grid-check none --show-superseded" in master, I see that the transformation "ED50 to ETRS89 (16), 0.2 m, Spain - mainland and Ceuta" is presented before "ED50 to ETRS89 (17), 0.2 m, Spain - Balearic Islands". PROJ would probably need an extra logic potentially fragile to make sure the Baleares is used before the Peninsula

@jjimenezshaw
Copy link
Contributor

jjimenezshaw commented Mar 28, 2021

PROJ would probably need an extra logic potentially fragile to make sure the Baleares is used before the Peninsula

What about what you did in #2619 (I mean, have a single tif)? I know it is a fix for this particular case. Here can be fixed under control having both grids in one file (es_ign_SPED2ETV2.tif) with two subdatasets.

I do not see a general way to cover this issue (two grids for the same transformation that overlap) efficiently. Imagine (they are not yet in PROJ-data), that there is a grid for Portugal for the ED50-ETRS89 transformation. Or for France. The overlapping areas will just use the bigger one (France over Spain, and Spain over Portugal).

@rouault
Copy link
Member Author

rouault commented Mar 29, 2021

What about what you did in #2619 (I mean, have a single tif)? I know it is a fix for this particular case

This PR has the same effect as #2619 while being more general

@rouault rouault merged commit 381d4f6 into OSGeo:master Mar 29, 2021
@github-actions
Copy link
Contributor

The backport to 8.0 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.0 8.0
# Navigate to the new working tree
cd .worktrees/backport-8.0
# Create a new branch
git switch --create backport-2622-to-8.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 381d4f6ff3d18efbcd4fdb626200dddab5f2c115
# Push it to GitHub
git push --set-upstream origin backport-2622-to-8.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.0

Then, create a pull request where the base branch is 8.0 and the compare/head branch is backport-2622-to-8.0.

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

Successfully merging this pull request may close these issues.

2 participants