Closed g-demarco closed 2 months ago
Indeed, the spec says
bbox REQUIRED if geometry is not null
but it is missing a constraint that it should not be specified if geometry is null. IMO, an item with a bbox has necessarily a geometry that is at least the polygon represented by the bbox.
Yep, I agree. I believe the intention was that if you have a bbox, you must also provide a geometry with at least the extent of the bounding box. The JSON Schema seems to already follow this, but we'll likely need to clarify this in the written spec. Or do people prefer to fix the JSON Schema? @cholmes
Anyway, to "solve" the issue in 1.0.0, you'd need to provide a geometry that is equivalent to the bbox.
Yes @m-mohr, the problem was found "explorating" the schema, it is clear that with a full geometry everything works fine. The problem should be just the mismatch between the schema and the specification.
Also, the clause:
"bbox": {
"not": {}
}
doesn't really seem to be working, but I don't know if it is a problem with the validator or something else.
@matthewhanson To do the Markdown PR, @m-mohr to do the JSON Schema.
If there is a bbox you must have a geometry. We couldn't find a use case for having a bbox and not a geometry as you could always provide the bbox also as geometry. If you have use cases, please let us know.
The JSON Schema seems to already follow this, but we'll likely need to clarify this in the written spec. Or do people prefer to fix the JSON Schema?
I agree that updating the written spec to state that bbox
should be non-null if and only if geometry
is non-null (otherwise, just set the geometry to the bbox).
It seems to be like the JSON schema is already enforcing this.
It seems like the written spec is correct on the dev branch: https://github.com/radiantearth/stac-spec/blob/dev/item-spec/item-spec.md
Good catch, thanks!
So we can close this? :-)
Just testing this:
Geometry | BBox | Result |
---|---|---|
Polygon | missing | Fails |
Polygon | null | Fails |
Polygon | BBox | Valid |
null | missing | Valid |
null | null | Fails |
null | BBox | Fails |
The results is compliant to https://github.com/radiantearth/stac-spec/blob/dev/item-spec/item-spec.md
Hi, I'm getting an error using the item schema (https://github.com/radiantearth/stac-spec/blob/master/item-spec/json-schema/item.json) I'm trying to create an item with a geometry equal to null, but with a populated bbox. Looking at the definition it should work, but i'm getting back this error:
I'm using a Draft7 compliant validator (https://github.com/Julian/jsonschema)
Any hint for how to address this problem?