opendatacube / datacube-explorer

Web-based exploration of Open Data Cube collections
Apache License 2.0
56 stars 31 forks source link

STAC API returning error when a specific field has no value #536

Closed fangfy closed 3 months ago

fangfy commented 12 months ago

STAC specification says: "No error must be returned if a specified field has no value for it in the catalog. For example, if the field "properties.eo:cloud_cover" is specified but there is no cloud cover value for an Item, a successful HTTP response must be returned and the Item entities will not contain that field.

DEAfrica user raised an issuee that a Server Error is returned when a request includes an attribte in "fields" that is not defined for a collection, e.g. curl 'https://explorer.digitalearth.africa/stac/search' -H 'content-type: application/json' --data-raw '{"limit": 10, "bbox": [-20.0, 10.0, -19.0, 11.0], "datetime": "2023-01-02T00:00:00.000001Z/2023-02-01T00:00:00Z", "collections": ["s1_rtc"], "fields": {"include": ["properties.sat:absolute_orb"]}}' This impacts search over multiple collections that have different attributes defined.

Looks like this might relates to how the fields search is handled.