Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support null feature geometries #176

Merged
merged 1 commit into from
Jun 5, 2023
Merged

Support null feature geometries #176

merged 1 commit into from
Jun 5, 2023

Commits on Nov 1, 2022

  1. Support null feature geometries

    [Per RFC 7946](https://www.rfc-editor.org/rfc/rfc7946#section-3.2), 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; with this change, that feature will be filtered out of a FeatureCollection, or in the case of a standalone Feature, it will be converted to `nil`.
    
    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 into `Geo.GeometryCollection` or `Geo.geometry()`. (After all, these are explicitly about _geometries_, so the unlocated feature doesn't seem to fit into the abstraction at all.)
    s3cur3 committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    e36d74f View commit details
    Browse the repository at this point in the history