[GH-3383] Preserve GeoParquet XYZ layouts and document M conversion - #3390
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Yes, I have read the Contributor Rules and Contributor Development Guide.
Is this PR related to a ticket?
Closes #3383. The PR title follows the
[GH-XXX]format.What changes were proposed in this PR?
GeoParquet writes currently infer dimensionality from the first coordinate's Z, so declared empty XYZ geometries, NaN Z values, and later finite Z values can become XY. Preserve the supported XY/XYZ layouts with the existing patched WKB writer and derive
geometry_typesfrom the emitted WKB header. Reuse one configured writer per geometry-column closure.Ignore empty envelopes when accumulating the file bbox and omit bbox metadata when no geometry contributes a spatial extent. Empty geometries still contribute their geometry types.
Document the existing measured-input conversion: GeoParquet 1.1 does not support M, so writes project XYM to XY and XYZM to XYZ. The writer remains limited to XY/XYZ with no embedded SRID, retaining the existing WKB encoding flavor. The tutorials advise storing needed M values separately before writing.
The existing JTS limitation for zero-member collections remains: with no coordinate sequence or member, a declared collection layout cannot be retained. Collections with typed empty members are covered by the regression tests.
How was this patch tested?
git diff --checkpassed.File tests construct independent ISO WKB fixtures and check both stored WKB and read-back geometries, footer
geometry_types, and bbox. Coverage includes empty XY/XYZ primitives, NaN Z, a finite Z after the first coordinate, multipart/nested empty members, both byte orders, null values, measured empty primitives, XYM/XYZM projection, and plain/dictionary input files.Did this PR include necessary documentation updates?
Yes. Updated the English and Chinese GeoParquet Spark tutorials with XYZ preservation and the explicit M conversion policy.