Skip to content

test(integration): raster-geometry predicate parity - #1237

Draft
james-willis wants to merge 2 commits into
apache:mainfrom
james-willis:jw/parity-geometry-accessors
Draft

test(integration): raster-geometry predicate parity#1237
james-willis wants to merge 2 commits into
apache:mainfrom
james-willis:jw/parity-geometry-accessors

Conversation

@james-willis

@james-willis james-willis commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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_Contains diverges identically. A pole-spanning RS_Within polygon 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.

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.
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