kbgg / qgis-stac-browser

Plugin for QGIS to browse and download assets from STAC APIs
Apache License 2.0
26 stars 9 forks source link

Temporal filter incompatible with STAC API spec #78

Open micpilon opened 3 years ago

micpilon commented 3 years ago

Queries made by the STAC browser are likely not compatible with the STAC API specification, in which time is parsed with the datetime argument.

For example, an HTTP request sent was:

POST https://.../api//search HTTP/1.1
Accept-Encoding: identity
Host: ...
User-Agent: Python-urllib/3.7
Content-Type: application/json; charset=utf-8
Content-Length: 183
Connection: close

{"collections": ["markham"], "bbox": [-123.6308868661519, 36.02789736179574, -28.151779495509228, 52.37970698302373], "time": "1959-01-01T00:00:00Z/1961-01-01T00:00:00Z", "limit": 50}

Which uses the time keyword for temporal filtering. This leads to ignoring the filter from the API's standpoint and loading all the items.

ymoisan commented 3 years ago

The culprit : https://github.com/kbgg/qgis-stac-browser/blob/e94b70376160a77f8ddabf3514297302337d9ad8/models/api.py#L47