| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
For GeoJSON Z support, the tests should include mixed 2D and 3D coordinates in the same geometry collection if PostgreSQL/PostGIS allows it. That catches serializers that infer dimensionality from the first coordinate and then drop or reject later Z values. It would also be useful to assert round-tripping of Position arrays with Z but no M, so Z support does not accidentally imply M handling. |
Sorry, something went wrong.
|
@hiSandog thanks for the review! Both scenarios are now covered, and digging into them turned up a related bug beyond just missing test coverage:
Pushed as a new commit on top of the branch. |
Sorry, something went wrong.
|
Rebased to match main new file organisation |
Sorry, something went wrong.
Typed Write methods wrote the Z double when a Position had an altitude, but never set the HasZ flag on the EWKB type header, so 3D geometries were serialized with a 2D type tag. Set type |= EwkbGeometryType.HasZ using a "first coordinate decides" assumption to avoid walking the entire geojson tree for an exhaustive check. Extend the existing all-or-none Z consistency validation to MultiPoint/MultiLineString/MultiPolygon/GeometryCollection members, matching what PostGIS enforces server-side (it rejects mixed 2D/3D collections with "Dimensions mismatch in lwcollection"). Point, LineString, and Polygon already guarded intra-geometry consistency; composite types had no equivalent check across members, which could corrupt the EWKB since the reader assumes uniform dimensionality based on the outer flag. Adds tests covering the new guards and a Z-without-M round-trip case.
| Back | FazBrowse Home | New Git URL |
As discussed in #6567
Original typed Write methods wrote the Z double when a Position had an altitude, but never set the HasZ flag on the EWKB type header.
So 3D geometries were serialized with a 2D type tag. This change sets type |= EwkbGeometryType.HasZ.
It's a "first coordinate decides" assumption, to avoid going over the entire geojson tree for exhaustive check.