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.
Hi there! Thanks for putting together such a rock-solid library. We've been using it happily in production for over a year.☺️
I recently encountered an odd corner of the GeoJSON spec thanks to a user-submitted file, and I'd love to have a way to handle it in Geo. Per RFC 7946, a Feature object's
"geometry"
member can be either a Geometry object or a JSON null value.Prior to this patch, you would get a
BadMapError
if you attempted to decode GeoJSON that included a feature with null geometry, thereby aborting the processing of all the data—in the case I encountered, one out of ~1000 features in a FeatureCollection was like this. With this patch, that Feature will be filtered out of the FeatureCollection, or in the case of a standalone Feature, it will be decoded tonil
.I'm not entirely convinced this is the right implementation—the GeoJSON RFC seems to indicate there may be some value in having an "unlocated" feature (I guess for its
properties
?). However, it seemed like a much bigger, scarier, and frankly less consistent change to introduce a non-located type intoGeo.GeometryCollection
orGeo.geometry()
. (After all, these are explicitly about geometries, so the unlocated feature doesn't seem to fit into the abstraction at all.)I'd love to get your thoughts on it.☺️