Skip to content

Conversation

@jesspav
Copy link
Collaborator

@jesspav jesspav commented Sep 13, 2025

EPSG:4326 has a unique CRS implementation that accepts an EPSG and OGC code. This was not working with the auth code's srid() function.

Current:

> SELECT ST_SRID(ST_SetSrid(ST_GeomFromText('POINT (100 100)'), 4326));
Execution error: CRS has no SRID

After fix:

> SELECT ST_SRID(ST_SetSrid(ST_GeomFromText('POINT (100 100)'), 4326));
┌──────────────────────────────────────────────────────────────────────────┐
│ st_srid(st_setsrid(st_geomfromwkt(Utf8("POINT (100 100)")),Int64(4326))) │
│                                  uint32                                  │
╞══════════════════════════════════════════════════════════════════════════╡
│                                                                     4326 │
└──────────────────────────────────────────────────────────────────────────┘

Testing

unit test + query validation

@jesspav jesspav requested a review from Copilot September 13, 2025 19:20
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 fixes a bug where EPSG:4326 coordinate reference systems were not returning a proper SRID value. The fix adds special handling for longitude/latitude coordinate systems to return SRID 4326 when the srid() function is called.

  • Modified the AuthorityCode::srid() implementation to handle lng/lat coordinate systems
  • Added test case to verify EPSG:4326 returns the correct SRID value

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 13, 2025 20:20
@jesspav jesspav requested review from paleolimbot and removed request for paleolimbot September 13, 2025 20:20
@jesspav jesspav marked this pull request as draft September 13, 2025 20:34
@jesspav jesspav marked this pull request as ready for review September 13, 2025 21:01
@jesspav jesspav requested a review from paleolimbot September 13, 2025 21:34
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 827232c into apache:main Sep 14, 2025
12 checks passed
@jesspav jesspav deleted the srid_4326 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