[GH-3153] Align CRS handling across raster operations - #3194
Draft
jiayuasu wants to merge 3 commits into
Draft
Conversation
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.
Closes #3153.
What changed
RS_Intersects,RS_Contains,RS_Within,RS_AsRaster,RS_Clip,RS_SetValues,RS_Value,RS_Values,RS_ZonalStats,RS_ZonalStatsAll, and the geometry variants ofRS_WorldToRasterCoord,RS_WorldToRasterCoordX, andRS_WorldToRasterCoordY.RS_DWithinbehavior unchanged: missing CRS or SRID metadata is still interpreted as WGS84.Why
Raster inputs can carry full CRS metadata even when that CRS has no EPSG identifier. Treating every missing geometry SRID as WGS84 can silently compare incompatible coordinates, while rejecting SRID 0 unconditionally makes non-EPSG rasters unreachable because JTS geometries cannot carry the raster's full CRS object.
The three-state contract rejects ambiguous combinations while keeping custom-CRS rasters usable with geometries expressed directly in their native coordinate space.
User impact
Topological raster operations now reject these ambiguous combinations with a stable error:
A non-EPSG raster accepts an SRID-0 geometry as native raster coordinates. Callers that intend an untagged geometry to be WGS84 should assign SRID 4326 explicitly.
Validation
mvn -o -pl common test— 1,175 tests passedmvn -o -Pscala2.12,sedona-spark-3.4 -pl spark/common -DwildcardSuites=org.apache.sedona.sql.RasterJoinSuite scalatest:test— 57 tests passedmvn -o -Pscala2.12,sedona-spark-3.4 -pl spark/common -DwildcardSuites=org.apache.sedona.sql.rasteralgebraTest scalatest:test— 167 tests passedmvn -o -Pscala2.12,sedona-spark-3.4 -pl spark/common -DwildcardSuites=org.apache.sedona.sql.BroadcastIndexJoinSuite,org.apache.sedona.sql.rasterIOTest scalatest:test— 86 tests passed