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

Disallow GeometryCollection, reformatting #1294

Merged
merged 6 commits into from
Jul 4, 2024
Merged

Conversation

m-mohr
Copy link
Collaborator

@m-mohr m-mohr commented Jun 27, 2024

Related Issue(s): #1160

Proposed Changes:

  1. Disallow GeometryCollection in Item Spec (as defined in the schema) GeometryCollection not allowed according to Item schema #1160
  2. Reformatted the Item Field table to be more lightweight by moving geometry, bbox, and collection descriptions to separate sections. Also, clarified that RFC section 3.1 and 3.2 apply, for Geometry Object and null respectively.

PR Checklist:

  • This PR is made against the dev branch (all proposed changes except releases should be against dev, not master).
  • This PR has no breaking changes.
  • I have added my changes to the CHANGELOG
    or a CHANGELOG entry is not required.
  • This PR affects the STAC API spec,
    and I have opened issue/PR #XXX to track the change.

@m-mohr m-mohr added this to the 1.1 milestone Jun 27, 2024
@m-mohr m-mohr linked an issue Jun 27, 2024 that may be closed by this pull request
Copy link
Collaborator

@emmanuelmathot emmanuelmathot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in the schema would enforce it at validation

diff --git a/item-spec/json-schema/item.json b/item-spec/json-schema/item.json
index ede4d62a..61475e1b 100644
--- a/item-spec/json-schema/item.json
+++ b/item-spec/json-schema/item.json
@@ -15,6 +15,30 @@
         {
           "$ref": "https://geojson.org/schema/Feature.json"
         },
+        {
+          "$comment": "Disallow GeometryCollection",
+          "not": {
+            "type": "object",
+            "required": [
+              "geometry"
+            ],
+            "properties": {
+              "geometry": {
+                "type": "object",
+                "required": [
+                  "type"
+                ],
+                "properties": {
+                  "type": {
+                    "enum": [
+                      "GeometryCollection"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
         {
           "oneOf": [
             {
@@ -260,4 +284,4 @@
       ]
     }
   }
-}
+}
\ No newline at end of file

@m-mohr
Copy link
Collaborator Author

m-mohr commented Jun 29, 2024

I thought we were already enforcing it in validation, I'll check, thanks.

See : #1160 (comment)

@emmanuelmathot
Copy link
Collaborator

yes right, with the coordinates fields

@m-mohr
Copy link
Collaborator Author

m-mohr commented Jun 29, 2024

This line enforces it, because it doesn't contain GeometryCollection:
https://github.com/radiantearth/stac-spec/blob/master/item-spec/json-schema/item.json#L47

If that's fine for you, you could approve it @emmanuelmathot

item-spec/item-spec.md Outdated Show resolved Hide resolved
item-spec/item-spec.md Outdated Show resolved Hide resolved
Co-authored-by: Pete Gadomski <[email protected]>
item-spec/item-spec.md Outdated Show resolved Hide resolved
@m-mohr
Copy link
Collaborator Author

m-mohr commented Jul 1, 2024

@gadomski @emmanuelmathot Ready for another review.

@emmanuelmathot emmanuelmathot merged commit 2055e7c into dev Jul 4, 2024
2 checks passed
@m-mohr m-mohr deleted the item-spec-bbox-geom branch July 4, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GeometryCollection not allowed according to Item schema
4 participants