jiayuasu opened a new issue, #3189:
URL: https://github.com/apache/sedona/issues/3189
## Expected behavior
Distributed `GeoSeries` and `GeoDataFrame` objects should preserve explicitly
assigned CRS metadata when their geometry rows are empty, all null, or carry
SRID 0.
Explicit `set_crs` values should take precedence over inherited lineage
metadata. Copies, GeoPandas conversion, and construction from an existing
geometry column should retain that metadata, while switching to a different
active geometry column must not leak the previous column's CRS.
## Actual behavior
Sedona normally derives CRS from the SRID stored in geometry rows. Empty and
all-null results have no non-null geometry from which to recover that SRID,
so
CRS can be lost after construction, copy, conversion, or a distributed
operation that removes every row.
The same fallback mechanism is currently being introduced independently by
#3183, #3184, and #3185. Keeping it in those feature PRs duplicates shared
state-management code and creates avoidable merge conflicts.
## Steps to reproduce the problem
```python
from sedona.spark.geopandas import GeoDataFrame, GeoSeries
series = GeoSeries([None], name="shape", crs="EPSG:4326")
frame = GeoDataFrame({"value": [1]}).set_geometry(series)
assert series.crs == "EPSG:4326"
assert frame.crs == "EPSG:4326"
assert frame.copy().crs == "EPSG:4326"
assert frame.to_geopandas().crs == "EPSG:4326"
```
The shared implementation should also cover zero-row derived results,
duplicate-index construction, explicit CRS removal or replacement, deep
`GeoSeries` copies, and active-geometry switches.
## Settings
Sedona version = 1.9.1-SNAPSHOT
Apache Spark version = 3.4+
API type = Python GeoPandas API
Python version = 3.8+
Environment = Standalone
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]