Skip to content

feat(rust/sedona-functions): Add ST_GeomFromEWKB and support item crs inputs to ST_SetSRID#547

Merged
paleolimbot merged 5 commits intoapache:mainfrom
paleolimbot:st-geom-from-ewkb
Jan 30, 2026
Merged

feat(rust/sedona-functions): Add ST_GeomFromEWKB and support item crs inputs to ST_SetSRID#547
paleolimbot merged 5 commits intoapache:mainfrom
paleolimbot:st-geom-from-ewkb

Conversation

@paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Jan 24, 2026

This PR adds the function ST_GeomFromEWKB (which constructs an item_crs, as opposed to ST_GeomFromWKB, which constructs a regular geometry).

In the process of completing the roundtrip testing I also realized that ST_SetSRID didn't support item CRS inputs, so I just fixed that so I could complete the roundtrip test.

Closes #489
Closes #490

@paleolimbot paleolimbot requested a review from Copilot January 26, 2026 19:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for reading EWKB (Extended Well-Known Binary) geometries, which include CRS information, and fixes ST_SetSRID to properly handle item_crs inputs for complete roundtrip testing.

Changes:

  • Added ST_GeomFromEWKB function to construct geometries with CRS from EWKB format
  • Updated ST_SetSRID and ST_SetCRS to support item_crs inputs by using parse_item_crs_arg helper functions
  • Enhanced test coverage with roundtrip EWKB tests and parameterized tests for item_crs inputs

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rust/sedona-functions/src/st_geomfromewkb.rs New file implementing ST_GeomFromEWKB function to parse EWKB and extract CRS information
rust/sedona-functions/src/st_setsrid.rs Updated to support item_crs inputs, refactored return type logic, and changed SRID validation from numeric to integer
rust/sedona-functions/src/register.rs Registered new ST_GeomFromEWKB function and reordered function list alphabetically
rust/sedona-functions/src/lib.rs Added module declaration for st_geomfromewkb
rust/sedona-expr/src/item_crs.rs Made helper functions public to support item_crs parsing in other modules
python/sedonadb/tests/functions/test_wkb.py Enhanced EWKB tests with roundtrip validation and updated test parameters
python/sedonadb/python/sedonadb/testing.py Added val_or_null helper method to format binary values as SQL literals for different engines

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paleolimbot paleolimbot merged commit 00393da into apache:main Jan 30, 2026
18 of 19 checks passed
@paleolimbot paleolimbot deleted the st-geom-from-ewkb branch January 30, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants