Closed Oreilles closed 10 months ago
Could you add a test for this?
Wkt -> GeoJSON test added. I wanted to add the reverse, but turns out the geojson
create doesn't accept it:
turns out the geojson create doesn't accept [empty points].
TBH I didn't realize geojson could represent empty points, but you've convinced me that it seems like a bug in the geojson crate. I've just opened https://github.com/georust/geojson/issues/231
Ok, so after further inspection it seems like PostGIS is the one deviating from the spec here...
https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1
A position is an array of numbers. There MUST be two or more
elements.
heh i noticed the same thing, but I thought maybe it was just sloppy spec writing, and that the "null geometry" thing seemed to trump the "position" thing.
Probably we should be careful with this one, and get some others to weigh in.
According to the RFC, empty points may be represented with empty coordinates:
This PR therefore implements the GeometryProcessor method
point_empty
forGeojsonWriter
by writing a point with empty coordinates. For reference, PostGIS also has this behavior: