test(integration): raster-geometry predicate parity - #1237
Draft
james-willis wants to merge 2 commits into
Draft
Conversation
RS_Intersects, RS_Contains, and RS_Within, one module per function. The roi travels as ST_GeomFromWKT (the suite's established input spelling); outputs are booleans and compare raw. Contained, overlapping, disjoint, and covering geometries all agree — 3 anchored passing tests.
EPSG:3413 pole-square and EPSG:4326 latitude-band fixtures queried from the other CRS, every point stating its coordinates in both CRSs so the expected answer is checkable against the native rectangle by hand. Truly-outside points and the reverse direction agree exactly; the densification discrepancy is proven and xfail-cataloged with apache/sedona#3323 — Sedona Spark reprojects the raster footprint with corner vertices only, so the lon/lat chords miss most of the polar cap and truly-inside points (even (45, 82), on the +x axis at 87% of the half-width) read false, where SedonaDB's densified footprint matches the exact truth. RS_Contains diverges the same way. A pole-spanning RS_Within polygon is its own xfail: flat lon/lat degenerates there — SedonaDB answers false where Sedona Spark throws, and neither models the spherical truth.
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.
Probe-first parity for RS_Intersects, RS_Contains, and RS_Within, one module per function. Geometry inputs use ST_GeomFromWKT as the merged zonal suite established; every output is a raw boolean, anchored — contained, overlapping, disjoint, and covering geometries all agree across engines. The geometry-returning accessors (RS_Envelope, RS_ConvexHull, RS_PixelAs*) are deliberately not here: raw geometry columns defeat the harness's tuple stringifier on both engines (SedonaDB geoarrow struct, Spark WKB), and wrapping RS outputs in ST_ machinery would make the tests depend on ST_ parity — they wait for a geometry-aware compare path.
3 passed; CI runs the parity lane.Polar cross-CRS cases and the densification proof
Per review: an EPSG:3413 pole-square and an EPSG:4326 latitude-band raster, each queried from the other CRS with points that state their coordinates in both CRSs (so every expected answer is checkable against the native rectangle by hand). Truly-outside points and the polar→lat/lon-band direction agree exactly. The densification discrepancy is proven and xfail-cataloged with apache/sedona#3323: Sedona Spark reprojects the raster footprint corner-only, so the lon/lat chords between corners miss most of the polar cap —
POINT(45 82)transforms to(867972, 0), on the +x axis at 87% of the half-width, and still reads false — where SedonaDB densifies each footprint edge (FOOTPRINT_POINTS_PER_EDGE) and matches the exact point-in-square truth on every probed case.RS_Containsdiverges identically. A pole-spanningRS_Withinpolygon is a separate xfail: flat lon/lat space degenerates there (SedonaDB answers false, Sedona Spark throws, and neither models the spherical truth).Now
10 passed, 6 xfailed.