feat(rust/sedona-functions,c/sedona-geos): Implement geography kernels for structural transformations and accessors#844
Open
paleolimbot wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends SedonaDB’s spatial function support so that a set of “mechanical” structural/accessor kernels accept geography inputs in addition to geometry, generally preserving the input type in the output. It also adds Python coverage for these geography transformations and updates GEOS-backed kernels to accept geography where appropriate.
Changes:
- Add geography-aware kernel matchers for multiple Rust
sedona-functionsUDFs that return the same type as their input. - Update GEOS-backed C/Rust kernels (e.g.,
ST_Boundary,ST_LineMerge,ST_Normalize, ring/point counters) to accept geography inputs. - Add a comprehensive Python test suite validating geography behavior for these mechanical transforms/accessors.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/sedona-functions/src/st_start_point.rs | Adds separate geometry/geography kernels for start/end point accessors and updates tests. |
| rust/sedona-functions/src/st_reverse.rs | Adds geography matcher support for ST_Reverse and updates tests. |
| rust/sedona-functions/src/st_points.rs | Adds geography matcher support for ST_Points and updates tests. |
| rust/sedona-functions/src/st_pointn.rs | Adds geography matcher support for ST_PointN and updates tests. |
| rust/sedona-functions/src/st_interiorringn.rs | Adds geography matcher support for ST_InteriorRingN and updates tests. |
| rust/sedona-functions/src/st_geometryn.rs | Adds geography matcher support for ST_GeometryN and updates tests. |
| rust/sedona-functions/src/st_force_dim.rs | Extends force-dimension UDF tests to include geography. |
| rust/sedona-functions/src/st_flipcoordinates.rs | Adds geography matcher support for ST_FlipCoordinates and updates tests. |
| python/sedonadb/tests/geography/test_geog_mechanical_transforms.py | New Python tests validating geography behavior for multiple mechanical transforms/accessors. |
| c/sedona-geos/src/st_numpoints.rs | Allows ST_NumPoints to accept geography via is_geometry_or_geography() and expands tests. |
| c/sedona-geos/src/st_numinteriorrings.rs | Allows ST_NumInteriorRings to accept geography via is_geometry_or_geography() and expands tests. |
| c/sedona-geos/src/st_nrings.rs | Allows ST_NRings to accept geography via is_geometry_or_geography() and expands tests. |
| c/sedona-geos/src/st_normalize.rs | Adds separate geometry/geography kernels for ST_Normalize and updates tests. |
| c/sedona-geos/src/st_line_merge.rs | Adds separate geometry/geography kernels for ST_LineMerge and updates tests. |
| c/sedona-geos/src/st_boundary.rs | Adds separate geometry/geography kernels for ST_Boundary and updates tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5710adc to
8d49a15
Compare
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.
This PR adds geography matchers for a whack of functions whose output is the same for geometry and geography:
There's no implementation changes here, only updates to the matchers so that we get geography -> geography and geometry -> geometry.
Closes #819