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/08 19:06:24 UTC

[PR] [GH-3329] Preserve empty LineString dimensions during deserialization [sedona]

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

   ## Did you read the Contributor Guide?
   
   Yes.
   
   ## Is this PR related to a ticket?
   
   Closes #3329. Alternative to #3332 that fixes the shared Python geometry decoder.
   
   ## What changes were proposed in this PR?
   
   An empty 2D LineString can acquire a Z dimension when Sedona deserializes it with older GEOS versions. This also changes the WKB type codes of an all-empty GeometryCollection during conversion to GeoPandas or Arrow.
   
   Construct empty LineStrings from their stored coordinate layout. For empty XY/XYZ sequences, use the explicit dimension constructor because the bulk coordinate-copy function in GEOS 3.10–3.11 also infers XYZ from an empty buffer. Keep the flag-aware bulk path for M/ZM sequences on GEOS versions that support them.
   
   Add exact WKB round-trip tests for empty LineStrings and nested collections, cover empty M/ZM LineStrings, restore the all-empty collection parity fixture, and remove the test workarounds that hid the dimension mismatch. No special case is needed in the Arrow export methods.
   
   ## How was this patch tested?
   
   - Before the fix, the strengthened C serialization suite had 5 failures on Shapely 2.0.7 / GEOS 3.11.4, including the reported collection and nested empty LineStrings.
   - Rebuilt the C extension and ran `tests/utils/test_geomserde_speedup.py`:
     - Python 3.8 / Shapely 1.8.5.post1 / GEOS 3.10.3: 17 passed, 11 skipped.
     - Python 3.9 / Shapely 2.0.7 / GEOS 3.11.4: 18 passed, 10 skipped.
     - Python 3.10 / Shapely 2.1.2 / GEOS 3.13.1: 28 passed, including empty M/ZM cases.
   - Python 3.9 / Spark 3.5.0 / GeoPandas 1.0.1 / PyArrow 17.0.0, using the released Sedona 1.9.0 shaded JAR and the rebuilt Python extension: `TestMatchGeopandasSeries::test_to_arrow`, `TestMatchGeopandasSeries::test_to_wkb`, and `TestGeoSeries::test_to_arrow` all passed, with the old empty-LineString/LinearRing workaround removed.
   - Direct distributed checks passed for `GeoSeries.to_geopandas()`, `GeoSeries.to_arrow()`, and `GeoDataFrame.to_arrow()` with an all-empty collection, an empty LineString, a 3D point, and a null.
   - All applicable pre-commit hooks, scoped `mvn spotless:apply`, and `git diff --check` passed.
   
   ## Did this PR include necessary documentation updates?
   
   No public API changes; existing conversion methods now preserve the empty LineString's stored dimension.
   


-- 
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-3329] Preserve dimensions of empty Points, LineStrings, and Polygons [sedona]

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


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