-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Description
The STAC Spec requires that Items have a datetime property even when the value of that property is null. However, in the return value of the search function removes the datetime property when it is null, resulting in an invalid STAC Item.
Steps to reproduce
- Start up the development server
- In a
psqlconsole, add an item withstart_datetimeandend_datetimevalues and anulldatetimevalue:SELECT * FROM create_item(' { "type": "Feature", "stac_version": "1.0.0", "id": "datetime_range_test", "properties": { "start_datetime": "2009-10-15T00:00:00Z", "end_datetime": "2010-03-01T23:59:59.999999Z", "datetime": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [-101, 36], [-101, 37], [-102, 37], [-102, 36], [-101, 36] ] ] }, "links": [], "assets": {}, "collection": "pgstac-test-collection" } '::jsonb);
- Use the
searchfunction to fetch the Item and examine the properties:SELECT "search" -> 'features' -> 0 -> 'properties' FROM search('{"ids": ["datetime_range_test"]}');
The resulting properties JSON is missing the datetime property:
{
"end_datetime": "2010-03-01T23:59:59.999999Z",
"start_datetime": "2009-10-15T00:00:00Z"
}Metadata
Metadata
Assignees
Labels
No labels