Skip to content

Ignore large, all-surrounding input extents for intersection calculation - #208

Merged
neilflood merged 2 commits into
ubarsc:masterfrom
neilflood:remove-surrounding-bboxes
Aug 6, 2026
Merged

Ignore large, all-surrounding input extents for intersection calculation#208
neilflood merged 2 commits into
ubarsc:masterfrom
neilflood:remove-surrounding-bboxes

Conversation

@neilflood

Copy link
Copy Markdown
Member

When calculating intersections for the working grid, a very large input extent which completely surrounds all others contributes nothing to the intersection. However, if sufficiently large, its bounds may not be valid to reproject into the working grid projection, potentially causing errors. This problem is discussed in #204.

To avoid this, a simpler check can be done first, in geographic coordinates (lat/long), to see if one extent completely surrounds all others, and it can be removed before calculating the intersection bounding box. This makes it much easier to intersect with a global background dataset, while still only working in the intersection of the local inputs of interest.

This is only applied for INTERSECTION, it makes no sense for UNION.

@gillins, @petescarth. I have added some tests for this procedure, but I would love to see some real-life tests to make sure I have not broken anything.

…extents which completely surround all others
@neilflood

Copy link
Copy Markdown
Member Author

I suspect that a working grid in Arctic Polar Stereographic projection would still have problems with this.
:-)

@neilflood
neilflood merged commit 7413461 into ubarsc:master Aug 6, 2026
6 checks passed
@neilflood
neilflood deleted the remove-surrounding-bboxes branch August 6, 2026 02:29
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.

1 participant