jiayuasu opened a new pull request, #3190: URL: https://github.com/apache/sedona/pull/3190
## Did you read the Contributor Guide? - Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/) ## Is this PR related to a ticket? - Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes #3189 ## What changes were proposed in this PR? This PR preserves CRS metadata when a distributed `GeoSeries` or `GeoDataFrame` has no geometry row from which Sedona can recover an SRID. It adds an explicit CRS fallback alongside the existing lazy lineage fallback. A nonzero geometry SRID remains authoritative; for empty, all-null, or SRID 0 results, explicit metadata takes precedence over inherited lineage metadata. The metadata is preserved through `set_crs`, construction from existing geometry columns, copies, and conversion to GeoPandas. Switching to a different active geometry column clears the old column's fallback so its CRS cannot leak. Construction with duplicate indexes updates SRID directly in the Spark column instead of performing index alignment. This extracts the shared CRS foundation needed by #3183, #3184, and #3185 so those feature branches can remove their duplicate copies after this PR merges. ## How was this patch tested? - `TestGeoSeries::test_set_crs` - `TestGeoDataFrame::test_construct_from_geopandas` - `TestGeoDataFrame::test_set_geometry` - `TestGeoDataFrame::test_set_geometry_crs` - `TestGeoDataFrame::test_copy` - Repository pre-commit hooks The tests cover empty and all-null geometries, explicit CRS replacement and removal, lazy lineage precedence, deep copies, GeoPandas conversion, duplicate-index construction, and both in-place and copied active-geometry switches. ## Did this PR include necessary documentation updates? - No, this PR does not affect any public API so no need to change the documentation. -- 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]
