Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeometryCollection not allowed according to Item schema #1160

Open
aznan2 opened this issue Oct 25, 2021 · 8 comments
Open

GeometryCollection not allowed according to Item schema #1160

aznan2 opened this issue Oct 25, 2021 · 8 comments
Assignees
Labels
bug json schema minor a relatively small change to the spec
Milestone

Comments

@aznan2
Copy link

aznan2 commented Oct 25, 2021

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.

@m-mohr
Copy link
Collaborator

m-mohr commented Oct 25, 2021

Hmm, indeed. It seems the GeoJSON Geometry schema is somewhat incomplete and we'd need to add the GeometryCollection schema separately...

@matthewhanson
Copy link
Collaborator

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

@m-mohr
Copy link
Collaborator

m-mohr commented Oct 25, 2021

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?

@matthewhanson
Copy link
Collaborator

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.

@m-mohr
Copy link
Collaborator

m-mohr commented Oct 25, 2021

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?). :-)

@matthewhanson
Copy link
Collaborator

I think in the markdown we can still reference the RFC, but state that GeometryCollection is not supported, which is enforced by the schema.

@m-mohr m-mohr added this to the 1.0.1 milestone Jan 3, 2022
@m-mohr m-mohr added the minor a relatively small change to the spec label May 2, 2023
@m-mohr m-mohr modified the milestones: 1.0.1, 1.1 May 2, 2023
@m-mohr
Copy link
Collaborator

m-mohr commented Sep 26, 2023

Discussed during the sprint: We don't allow GeometryCollection and remove it from the Item Spec Markdown.

@PowerChell
Copy link

Just needs a PR and then can close @matthewhanson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug json schema minor a relatively small change to the spec
Projects
None yet
Development

No branches or pull requests

4 participants