You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/09/15 08:16:57 UTC

[PR] [GH-3375] GeoPandas: write the frame's CRS when saving GeoParquet [sedona]

jiayuasu opened a new pull request, #3376:
URL: https://github.com/apache/sedona/pull/3376

   ## 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 #3375
   
   ## What changes were proposed in this PR?
   
   `GeoDataFrame.to_parquet` / `to_file` wrote GeoParquet without a `geoparquet.crs` option, so the writer derived the CRS from the geometry SRIDs. A CRS assigned on the frame, for example `GeoDataFrame(spark_df, geometry="geometry", crs="EPSG:4326")`, is kept in the geometry column metadata and does not reach those SRIDs, so the files were written with `"crs": null`.
   
   `_to_file` now passes the CRS from the active geometry column's metadata to the writer as PROJJSON when the caller has not set `geoparquet.crs`. It reads the metadata rather than `GeoDataFrame.crs`, which falls back to an eager SRID lookup when no metadata is present. Frames without CRS metadata keep the existing SRID-derived behavior.
   
   ## How was this patch tested?
   
   - Added `test_to_parquet_writes_crs_of_spark_backed_frame`, which builds a frame from a Spark DataFrame with `crs="EPSG:4326"`, writes it with `to_parquet`, and checks `geopandas.read_parquet(path).crs`. It fails without this change (`assert None == 'EPSG:4326'`) and passes with it.
   - `pytest tests/geopandas`: 896 passed, 1 skipped (Spark 4.1.3, Python 3.11, local mode).
   
   ## 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: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-3375] GeoPandas: write the frame's CRS when saving GeoParquet [sedona]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #3376:
URL: https://github.com/apache/sedona/pull/3376


-- 
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: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org