placemark / check-geojson

a checker for the geojson format. goes beyond a schema, checking semantics and producing character-level warnings.

Home Page:http://check-geojson.docs.placemark.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature parsing should not accept nulls

disarticulate opened this issue · comments

{ type: 'Feature', properties: null, geometry: null }

Appears to be a valid object. Maybe I'm missing something in the spec but I'd expect at a minimum the geometry property to not be null.

Null geometry is valid per the geojson spec.

"A Feature object has a member with the name "geometry". The value of the geometry member SHALL be either a Geometry object as defined above or, in the case that the Feature is unlocated, a JSON null value."

Yep, per the spec, both properties and geometry can be null: https://www.rfc-editor.org/rfc/rfc7946#section-3.2 It’s weird, but the intent is to follow the spec precisely.

Closing - this is following the spec. If there's software that doesn't handle null geometries or properties, that software has a bug.