Repository navigation
Conversation
…icates Cross-CRS RS_Intersects/Contains/Within previously reprojected both the raster footprint and the query into WGS84. Corner-only chords under-cover polar and other highly curved footprints (apache#3323). Prefer transforming the geometry into the raster's native CRS (SedonaDB parity) so the footprint stays exact; fall back to WGS84 when that transform fails. Raster-raster predicates keep the WGS84 path for antimeridian safety. Signed-off-by: Vincent <ump45nose@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes RS_ raster predicates: transform geometry into the raster CRS for cross-CRS comparison (match SedonaDB) #3155Also addresses the polar false-negative repro in #3323 (same root cause: corner-only WGS84 chords).
What changes were proposed in this PR?
For cross-CRS
RS_Intersects/RS_Contains/RS_Within(raster vs geometry), prefer transforming the query geometry into the raster's CRS and comparing there, instead of reprojecting both sides to WGS84.A raster footprint is an exact straight-edged quadrilateral in its native CRS (pixel→world is affine). Reprojecting only the four corners to WGS84 under-covers curved edges — dramatically so for polar rasters (#3323). Moving the transform onto the (usually smaller) geometry keeps the footprint exact and matches SedonaDB's
rs_spatial_predicatespreference.If transforming the geometry into the raster CRS fails, fall back to the previous both-to-WGS84 path (preserves antimeridian behavior). Raster–raster predicates still compare in WGS84 for the same antimeridian safety.
How was this patch tested?
All 33 tests pass, including a new
testIntersectsPolarRasterInNativeCrscovering the EPSG:3413 2000 km north-pole square repro from #3323 (POINT(45 82),POINT(180 85),POINT(0 85),POINT(90 85)→ intersect/contain true;POINT(0 60)→ false).Did this PR include necessary documentation updates?
AI assistance
Assisted by an AI coding agent (Cursor / Grok Bot) for implementation and test drafting; human review of the approach and validation against SedonaDB parity and existing antimeridian tests.