Is it valid to have a properties element in an geoJSON featureCollection?

The short answer is no - it is not valid to have a properties element on a FeatureCollection object:

https://tools.ietf.org/html/rfc7946#section-7.1

The GeoJSON "geometry" and "properties" members define a Feature object. FeatureCollection and Geometry objects, respectively, MUST NOT contain a "geometry" or "properties" member.


2.3. Feature Collection Objects

A GeoJSON object with the type "FeatureCollection" is a feature collection object.

An object of type "FeatureCollection" must have a member with the name "features". The value corresponding to "features" is an array. Each element in the array is a feature object as defined above.

I think this clearly implies that if the object has additional members that doesn't make it invalid.

Ecmascript objects are very open.

So yes, you can have a properties element at the top level of a feature collection, but don't expect any tools to know its there, or to copy it, ...

Tags:

Geojson