Skip to content

feat(rust/sedona-raster-functions): add RS_GeoTransform composite accessor - #1221

Draft
james-willis wants to merge 2 commits into
apache:mainfrom
james-willis:james/db-384-implement-rs_geotransform-in-sedonadb
Draft

feat(rust/sedona-raster-functions): add RS_GeoTransform composite accessor#1221
james-willis wants to merge 2 commits into
apache:mainfrom
james-willis:james/db-384-implement-rs_geotransform-in-sedonadb

Conversation

@james-willis

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

Copy link
Copy Markdown
Contributor

Adds RS_GeoTransform, the composite geotransform accessor, to sedona-raster-functions. The individual component accessors (RS_ScaleX/Y, RS_SkewX/Y, RS_UpperLeftX/Y, RS_Rotation) already lived in rs_geotransform.rs; this returns the decomposition Sedona Spark reports: a struct of magnitudeI, magnitudeJ, thetaI, thetaIJ, offsetX, offsetY (six non-nullable Float64 fields, matching Spark's schema and field names).

The decomposition math mirrors Sedona Spark's RasterAccessors#getGeoTransform exactly, including the two acos sign tests, since Spark is the parity target. One consequence worth noting for reviewers: Spark's thetaI only agrees with our existing RS_Rotation (atan2(-skewX, scaleX)) when |skewX| == |skewY| — i.e. they agree for north-up and rigidly-rotated rasters but diverge under shear. That existing RS_Rotation divergence from Spark is not touched here.

…essor

Returns the geotransform decomposition Sedona Spark reports: a struct of
magnitudeI, magnitudeJ, thetaI, thetaIJ, offsetX, offsetY. The math mirrors
Spark's RasterAccessors#getGeoTransform exactly (including the acos sign
tests) since Spark is the parity target; thetaI therefore only agrees with
the existing RS_Rotation when |skewX| == |skewY|.

The parity harness's result_to_tuples now passes struct columns through as
dicts (they cannot be cast to string), matching the list-column treatment,
and the spark-parity suite gains anchored north-up and 3-4-5-skew cases.
@james-willis
james-willis force-pushed the james/db-384-implement-rs_geotransform-in-sedonadb branch from eebb594 to f14c66e Compare September 2, 2026 20:31
Move the RS_GeoTransform cases into their own test_rs_geotransform.py,
rename test_rs_scalar.py -> test_rs_bandnodatavalue.py and
test_rs_raster_out.py -> test_rs_setbandnodatavalue.py to match their
single-function contents, and record the file-per-function convention in
the suite README.
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