[DRAFT][Geo][SQL] Enhance SRID/CRS support based on PROJ data#54543
Draft
uros-db wants to merge 4 commits intoapache:masterfrom
Draft
[DRAFT][Geo][SQL] Enhance SRID/CRS support based on PROJ data#54543uros-db wants to merge 4 commits intoapache:masterfrom
uros-db wants to merge 4 commits intoapache:masterfrom
Conversation
mkaravel
reviewed
Feb 27, 2026
| */ | ||
| private void addOgcOverride(int srid, String ogcStringId) { | ||
| SpatialReferenceSystemInformation existing = sridToSrs.get(srid); | ||
| if (existing != null) { |
Contributor
There was a problem hiding this comment.
Given that the intent here is that we override an existing value, I think it would be best to throw an error if existing is null. Something like:
if (existing == null) {
throw new RuntimeException("SRID " + srid + " should have already been registered");
}
SpatialReferenceSystemInformation ogcEntry =
new SpatialReferenceSystemInformation(srid, ogcStringId, existing.isGeographic());
sridToSrs.put(srid, ogcEntry);
stringIdToSrs.put(ogcStringId, ogcEntry);
stringIdToSrs.put(existing.stringId(), ogcEntry);
Comment on lines
+347
to
+348
| # Add Spark-specific entry: SRID 0 (Cartesian, no defined SRS). | ||
| all_entries.append((0, "SRID:0", False)) |
Contributor
There was a problem hiding this comment.
I think it makes more sense to do this inside the SpatialReferenceSystemCache.java and geo_utils.py instead of here. I believe it is cleaner that the data generated by this script map completely to what we get from Proj.
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.
What changes were proposed in this pull request?
Extends Spark's Spatial Reference System (SRS) support to 10000+ entries sourced from the PROJ library's EPSG
and ESRI databases, substantially improving the breadth of GeometryType and GeographyType support.
Why are the changes needed?
Currently, Geometry and Geography types offer only limited SRID support (a few hardcoded values).
Does this PR introduce any user-facing change?
Yes, 10000+ additional SRID/CRS values are supported for geospatial types.
How was this patch tested?
Updated the corresponding unit tests for SRS mapping.
Was this patch authored or co-authored using generative AI tooling?
Yes, Claude 4.6 Opus.