[GeoJSON] Arrays in GeoJSON are allowed to be empty?

Mateusz Loskot mateusz at loskot.net
Fri Apr 17 02:38:58 PDT 2015


H,

Microsoft 's "Modifications to GeoJSON for Use in OData" [1] says:

"""
The GeoJSON [GeoJSON] standard requires that type LineString contains a minimum
number of positions in its coordinates collection. This prevents
serializing certain valid
geospatial values. Therefore, in GeoJSON, the requirement that is stated as
“For type ‘LineString’, the ‘coordinates’ member must be an array of
two or more positions”
is replaced with the requirement “For type ‘LineString’, the
‘coordinates’ member must be
an array of positions” when used in OData.

All other arrays in GeoJSON are allowed to be empty, so no change is necessary.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ?
"""

How to understand that interpretation the of GeoJSON spec?

Does it say
a) this is invalid
    { "type": "LineString", "coordinates": [] }
b) this is invalid
    { "type": "MultiLineString", "coordinates": [] }
c) but, this is valid
    { "type": "MultiPoint", "coordinates": [] }
?

The question is not about typed empty geometries as in OGC
I've already got that clarified [2] there is no such thing in GeoJSON.

[1] https://msdn.microsoft.com/en-us/library/hh554611.aspx
[2] http://lists.geojson.org/pipermail/geojson-geojson.org/2013-October/000839.html

Best regards,
-- 
Mateusz  Loskot, http://mateusz.loskot.net


More information about the GeoJSON mailing list