Skip to content

#6567 add support for writing GeoJSON with Z values#6602

Open
xfischer wants to merge 3 commits into
npgsql:mainfrom
xfischer:feature/6567-geojson-writez
Open

#6567 add support for writing GeoJSON with Z values#6602
xfischer wants to merge 3 commits into
npgsql:mainfrom
xfischer:feature/6567-geojson-writez

Conversation

@xfischer

@xfischer xfischer commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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.

xfischer added 2 commits June 9, 2026 18:27
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.
@xfischer xfischer requested review from roji and vonzshik as code owners June 9, 2026 16:35
Simplified hasZ declaration, added partial Z test, used already existing HasZ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant