linked-places-format icon indicating copy to clipboard operation
linked-places-format copied to clipboard

Features without location data

Open docuracy opened this issue 3 years ago • 3 comments

LP standard at present requires coordinates within geometries. The GeoJSON standard allows for unlocated features but requires that they have null geometry.

PROPOSAL: Drop the requirement for coordinates to allow for standard GeoJSON representation of unlocated features. This will be useful not only for the validation of datasets where features have yet to be located, but also for datasets where location might be inappropriate (see this proposal).

docuracy avatar Feb 24 '22 16:02 docuracy

The language in the spec is an interpretation of Section 3.1 of the GeoJSON spec. Open to other interpretations!

A GeoJSON Geometry object of any type other than "GeometryCollection" has a member with the name "coordinates". The value of the "coordinates" member is an array. The structure of the elements in this array is determined by the type of geometry. GeoJSON processors MAY interpret Geometry objects with empty "coordinates" arrays as null objects.

kgeographer avatar Feb 25 '22 00:02 kgeographer

Yes, I agree the spec isn't very clear here.... But I think the key fine print here is that the spec speaks about the geometry object.

We've been representing featuress without a geometry by giving them a geometry object, but with empty coordinates. That didn't work with our map/parsers. (I guess some parser MAY accept them, as the spec suggests. But not MapLibre, which is what we're using. I'm assuming MapBoxGL.js likely behaves the same.) The safe way - which is hinted here, but not very clearly - is to represent unlocated features as feature objects where the geometry is a null. That has worked for us in MapLibre.

rsimon avatar Feb 25 '22 06:02 rsimon

Just tested use of null for a geometry in a Leaflet L.geoJSON layer, and it also is fine -- simply not rendered. I am editing the LP spec accordingly.

kgeographer avatar Feb 25 '22 16:02 kgeographer