Closed aznan2 closed 2 months ago
Hmm, indeed. It seems the GeoJSON Geometry schema is somewhat incomplete and we'd need to add the GeometryCollection schema separately...
The GeometryCollection geometry type was intentionally left out, because it's not a widely supported geometry type, and the current GeoJSON spec recommends against the use of them: https://datatracker.ietf.org/doc/html/rfc7946#page-9
But still, the spec doesn't cover that and it would at least need a clarification in the Markdown then.
Where is it discouraged though? I only see that they should not be nested?
The language may have been updated, I've generally used the advice given in https://macwright.com/2015/03/23/geojson-second-bite.html#multi-geometries but granted that's a bit old now. GeometryCollections historically have not been well supported by tooling, and I think the use case for them is pretty rare and narrow, since you can do the same thing with more flexibility using a FeatureCollection.
I think doing intersections with geometry collections may be more difficult implementation wise, as backends may not supported mixed geometry single queries.
Yes, all agreed. We have also discouraged the usage in openEO etc, but we need to find a good way to disallow them in the Markdown then (is that breaking? Or is it not breaking because it's enforced by the schema?). :-)
I think in the markdown we can still reference the RFC, but state that GeometryCollection is not supported, which is enforced by the schema.
Discussed during the sprint: We don't allow GeometryCollection and remove it from the Item Spec Markdown.
Just needs a PR and then can close @matthewhanson
The section for the geometry field in item-spec.md refers to RFC 7946, section 3.1, which includes all seven geometry types, so I assume that the intent is that items can have a GeometryCollection.
In the JSON schema, the geometry field must be null or conform to https://geojson.org/schema/Geometry.json. However, this file only defines the six base geometry types and does not allow for the object to be a GeometryCollection.
Not sure if this is actually an issue with the GeoJSON schema but as things stand, items with a GeometryCollection as its geometry will not validate against the schema.