You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2026/10/14 22:11:06 UTC

[PR] fix(sedona-geoparquet): preserve null CRS and primary column [sedona-db]

paleolimbot opened a new pull request, #1447:
URL: https://github.com/apache/sedona-db/pull/1447

   Preserves the GeoParquet distinction between a missing CRS and an explicit null CRS, allowing unknown-CRS geometry columns to round-trip correctly. Carries the declared primary column through Arrow field metadata so reads and rewrites honor it. Updates sedonadb-geopandas behavior, documentation, and regression coverage.
   
   closes #1404
   
   ```python
   import geopandas as gpd
   import sedonadb
   
   gpd.GeoDataFrame(geometry=gpd.points_from_xy([0], [0])).to_parquet("null.parquet")
   df = sedonadb.connect().read_parquet("null.parquet")
   print(df.schema.field("geometry").type.crs)
   # None
   ```


-- 
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] fix(sedona-geoparquet): preserve explicit null CRS [sedona-db]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu commented on code in PR #1447:
URL: https://github.com/apache/sedona-db/pull/1447#discussion_r4292307928


##########
rust/sedona-geoparquet/src/writer.rs:
##########
@@ -740,10 +740,7 @@ fn normalize_crs_for_geoparquet(
 
         Ok(Some(crs_value))
     } else {
-        exec_err!(
-            "Can't write GeoParquet from null CRS\nUse ST_SetSRID({}, ...) to assign it one",
-            field_name
-        )
+        Ok(Some(Value::Null))

Review Comment:
   Could we preserve unknown CRS for `geoparquet_version='none'` too? I reran `preserves_null_crs` with this factory in `write_dataframe_to_path` (and skipped the `geo` metadata assertion):
   
   ```rust
   GeoParquetFormatFactory::new_with_options(TableGeoParquetOptions {
       geoparquet_version: GeoParquetVersion::Omitted,
       ..Default::default()
   })
   ```
   
   The final schema check fails:
   
   ```text
   expected: WkbView(Planar, None)
   actual:   WkbView(Planar, Some(OGC:CRS84))
   ```
   
   The input `POINT (1 1)` has no CRS, but the native Parquet annotation omits CRS and the reader assigns CRS84. Maybe encode an explicit unknown CRS in the native annotation, or keep rejecting null for this mode until it can round-trip?



-- 
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] fix(sedona-geoparquet): preserve explicit null CRS [sedona-db]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on code in PR #1447:
URL: https://github.com/apache/sedona-db/pull/1447#discussion_r4298553833


##########
rust/sedona-geoparquet/src/writer.rs:
##########
@@ -740,10 +740,7 @@ fn normalize_crs_for_geoparquet(
 
         Ok(Some(crs_value))
     } else {
-        exec_err!(
-            "Can't write GeoParquet from null CRS\nUse ST_SetSRID({}, ...) to assign it one",
-            field_name
-        )
+        Ok(Some(Value::Null))

Review Comment:
   Fixed!



-- 
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] fix(sedona-geoparquet): preserve explicit null CRS [sedona-db]

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


-- 
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