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

Always fallback to default coordinate operations when bounding box transfrom fails #60759

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nyalldawson
Copy link
Collaborator

Bounding box transforms are inherently approximate, so we can safely just fallback to the proj default operation if the user-specified operation fails when transforming a bounding box.

This fixes cases where the user-specified operation involves a grid shift and the bounds to transform falls outside of the grid. In this case proj_trans_bounds fails. By falling back to a proj default operation and re-trying then we get a valid approximate transformation of the bounding box.

Fixes map rendering issues when users are using a grid shift operation to transform layers to map CRS

Fixes #60737
Fixes #60753

@nyalldawson nyalldawson added Regression Something which used to work, but doesn't anymore backport release-3_40 backport release-3_42 labels Feb 25, 2025
…ansfrom fails

Bounding box transforms are inherently approximate, so we can safely
just fallback to the proj default operation if the user-specified
operation fails when transforming a bounding box.

This fixes cases where the user-specified operation involves a
grid shift and the bounds to transform falls outside of the grid.
In this case proj_trans_bounds fails. By falling back to a proj
default operation and re-trying then we get a valid approximate
transformation of the bounding box.

Fixes map rendering issues when users are using a grid shift operation
to transform layers to map CRS

Fixes qgis#60737
Fixes qgis#60753
Copy link

github-actions bot commented Feb 25, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 5a330ed)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 5a330ed)

@github-actions github-actions bot added this to the 3.44.0 milestone Feb 26, 2025
@@ -127,6 +127,51 @@ def testTransformQgsRectangle_Regression17600(self):
myTransformedExtentReverse.yMinimum(), myExtent.yMinimum()
)

def test_transform_bounding_box_grid(self):
"""
This test assumes the ca_nrc_NA83SCRS.tif grid is available on the system!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, can you skip the test if ca_nrc_NA83SCRS.tif is not available?

Copy link
Collaborator Author

@nyalldawson nyalldawson Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know any way to determine that reliably. (The test will just silently pass if the grid isn't available, as the default operation will always be used).

At least on the Qt 6 Fedora builds the grids are installed, I'm not sure about the Qt5 CI runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_40 backport release-3_42 Regression Something which used to work, but doesn't anymore
Projects
None yet
3 participants