Repository navigation
Description
Problem
Sedona's distributed GeoPandas layer uses field metadata to distinguish a known CRS from a geometry column whose CRS must be inferred from its embedded SRID. A locally constructed geometry column with crs=None currently has no CRS metadata, so it is indistinguishable from a raw distributed geometry column with unknown provenance.
Reading .crs for such a metadata-free column performs a distributed ST_SRID(first(...)) aggregation. APIs that inspect both operands' CRS, including binary geometry predicates, can therefore launch two eager Spark actions before returning an otherwise lazy result.
In a local Spark benchmark, comparing two CRS-less local operands submitted four Spark jobs before result materialization. Recording authoritative no-CRS metadata reduced that count to zero. The one-time constructor cost increased by approximately 2.3 ms for GeoSeries and 4.9 ms for GeoDataFrame in a warm one-row benchmark.
Expected behavior
Sedona should represent three distinct states:
- a known CRS stored as CRS metadata;
- a known absence of CRS stored as explicit empty CRS metadata; and
- an unknown raw or legacy distributed geometry column with no CRS metadata, which retains the existing embedded-SRID fallback.
The implementation should:
- record explicit no-CRS metadata for locally owned
GeoSeriesandGeoDataFramegeometry columns; - preserve locally supplied per-column CRS values and synchronize their embedded SRIDs;
- propagate authoritative CRS state through
set_geometry, WKT/WKB and file constructors, copies, selections, and all-null geometry columns; - preserve public
crs=Nonewithout erasing an embedded EWKB SRID; - leave raw Spark and pandas-on-Spark geometry columns without metadata on the existing SRID-inference path;
- preserve Series names, indexes, active-geometry selection, and laziness; and
- add action-count, metadata propagation, raw-column fallback, and compatibility coverage across supported Spark and GeoPandas versions.
Performance acceptance
- Constructing a binary predicate result from two locally created CRS-less operands should launch no Spark jobs solely for CRS discovery.
- Metadata-free raw distributed operands should continue to infer their embedded SRIDs and warn when they differ.
- The returned predicate and geometry plans should remain distributed and should not add Python execution nodes.
Part of #2230.
Sedona version
2.0.0-SNAPSHOT
API type
Python / distributed GeoPandas API
Activity
minhpham1810 commentedon Aug 23, 2026
I'd like to work on this. Root cause looks to be
GeoSeries.__init__only callingset_crswhencrs is not None, so locally-constructed columns never get authoritative "no CRS" metadata written (the tri-state scheme from #3190 already supports it, just isn't wired up for thecrs=Nonecase). Planning to fix the constructor path plusfrom_wkt/from_wkb/set_geometry, and add job-count regression tests per the acceptance criteria above.jiayuasu commentedon Aug 24, 2026
@minhpham1810 Sounds good. Your direction looks right, and #3190 provides the tri-state foundation. Please make sure authoritative crs=None is attached metadata-only rather than through set_crs(None), preserve per-column and inherited CRS behavior in GeoDataFrame/set_geometry, leave metadata-free distributed columns on SRID inference, include file constructors, and add actual Spark job-count and no-Python-plan tests.
minhpham1810 commentedon Aug 24, 2026
Thanks. I'll put up a PR soon.
[apacheGH-3271] Preserve per-column geometry CRS metadata
[apacheGH-3271] Resolve renamed GeoSeries columns
[GH-3271] Enhance GeoDataFrame and GeoSeries to handle authoritative … (