#6567 add support for writing GeoJSON with Z values by xfischer · Pull Request #6602 · npgsql/npgsql
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.