Skip to content

Add ST_CRS#38

Merged
jiayuasu merged 6 commits intoapache:mainfrom
jesspav:st_crs
Sep 10, 2025
Merged

Add ST_CRS#38
jiayuasu merged 6 commits intoapache:mainfrom
jesspav:st_crs

Conversation

@jesspav
Copy link
Collaborator

@jesspav jesspav commented Sep 8, 2025

Summary

Adding ST_CRS so that we can pull the full CRS object from geometry where SRIDs do not apply (for example with non-EPSG codes).

Issue: #29

Examples

> select ST_crs(ST_SetCrs(ST_GeomFromText('POINT (1 1)'), 'EPSG:4329')) as crs;
┌───────────┐
│    crs    │
│    utf8   │
╞═══════════╡
│ EPSG:4329 │
└───────────┘

> select ST_crs(ST_SetCrs(ST_GeomFromText('POINT (1 1)'), 'EPSG:4326')) as crs;
┌───────────┐
│    crs    │
│    utf8   │
╞═══════════╡
│ OGC:CRS84 │
└───────────┘


> select ST_crs(ST_SetSrid(ST_GeomFromText('POINT (1 1)'), null)) as crs;
┌──────┐
│  crs │
│ utf8 │
╞══════╡
│      │
└──────┘

@jesspav jesspav requested a review from Copilot September 8, 2025 22:02
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_CRS function to return the coordinate reference system (CRS) of a geometry, which complements the existing ST_SRID function by supporting non-EPSG codes.

  • Implements ST_CRS function that returns the full CRS object as a string
  • Adds comprehensive test coverage for the new function
  • Registers the new function in the default function set

Reviewed Changes

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

File Description
rust/sedona-functions/src/st_srid.rs Implements the core ST_CRS function logic and adds comprehensive unit tests
rust/sedona-functions/src/register.rs Registers the new ST_CRS function in the default function set
python/sedonadb/tests/functions/test_transforms.py Adds integration tests for both ST_SRID and ST_CRS functions

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

jesspav and others added 2 commits September 8, 2025 15:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jesspav jesspav marked this pull request as ready for review September 8, 2025 22:40
@jesspav jesspav requested a review from paleolimbot September 8, 2025 23:14
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.

Great! Just a few minor comments!

@jesspav jesspav changed the title [WIP] Add ST_CRS Add ST_CRS Sep 9, 2025
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.

A few things to consider now or in a follow-up!

(Also the merge conflict so that CI can run!)

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 e01a542 into apache:main Sep 10, 2025
9 checks passed
@jesspav jesspav deleted the st_crs 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