Skip to content

Conversation

@jesspav
Copy link
Collaborator

@jesspav jesspav commented Sep 5, 2025

This change adds ST_SRID to retrieve a geometry's CRS' SRID.

This is the first step in #28 . Will implement #29 before adding the integration tests to align the schemas.

Example

> select ST_SRID(ST_SetSrid(ST_GeomFromText('POINT (1 1)'), 'EPSG:4837')) as srid;
┌────────┐
│  srid  │
│ uint32 │
╞════════╡
│   4837 │
└────────┘

@jesspav jesspav requested a review from Copilot September 5, 2025 18:05
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 the ST_SRID function to retrieve the spatial reference system identifier (SRID) from coordinate reference systems. The implementation extends the CRS trait with a new srid() method and provides a scalar UDF for exposing this functionality.

  • Add srid() method to the CoordinateReferenceSystem trait
  • Implement ST_SRID scalar function that returns the SRID as a UInt32
  • Add comprehensive test coverage for both CRS implementations and the new function

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
rust/sedona-schema/src/crs.rs Add srid() method to CRS trait and implement for AuthorityCode and ProjJSON types
rust/sedona-functions/src/st_srid.rs New ST_SRID scalar function implementation with comprehensive tests
rust/sedona-functions/src/register.rs Register the new ST_SRID function in the default function set
rust/sedona-functions/src/lib.rs Add module declaration for st_srid

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jesspav jesspav marked this pull request as ready for review September 5, 2025 18:23
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thank you!

@jiayuasu jiayuasu merged commit 5d3cfba into apache:main Sep 5, 2025
5 checks passed
@jesspav jesspav deleted the add_st_srid branch November 14, 2025 22:21
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.

3 participants