geodesic.stac.search¶
- geodesic.stac.search(bbox=None, datetime=None, intersects=None, collections=None, ids=None, limit=10, page_size=500, query=None, filter=None, fields=None, sortby=None, method='POST', project=None)[source]¶
Deprecated in 1.0.0
Search through the SeerAI STAC catalogue.
Use the search function on the STAC catalogue using the STAC API version of search. The STAC api is described [here](https://stacspec.org/STAC-api.html#operation/postSearchSTAC).
- Args:
bbox: list or tuple of coordinates describing a bounding box. Should have length should be either 4 or 6. datetime: Either a datetime or interval expressed as a string. Open ended intervals can be expressed using double-dots ‘..’. If given as a string datetimes must be in RFC3339 format. See examples below for different formats. intersects: Only items that intersect this geometry will be included in the results. Can be either geojson or object that has __geo_interface__. collections: List of strings with collection IDs to include in search results. ids: List of item IDs to return. All other filter parameters that further restrict the search are ignored. limit: The maximum number of results to return. query: a STAC query in the format of the STAC query extension filter: a CQL2 JSON filter fields: a list of fields to invlude/exclude. Included fields should be prefixed by ‘+’ and excluded fields by ‘-’. Alernatively, a dict with a ‘include’/’exclude’ lists may be provided sortby: a list of sortby objects, with are dicts containing ‘field’ and ‘direction’ method: Request method to use. Valid options are ‘POST’ (default) and ‘GET’. Normally you should not have to change this from the default. project: the project to search in.
- Examples:
An example search.
>>> from geodesic.stac import search >>> search( ... bbox=[(-122.80058577975704, 40.72377233124292, -122.7906160884923, 40.726188159862616)], ... datetime="2021-06-15T00:00:00", ... collections: ['sentinel-2-l2a] ... )
Datetimes can be passed as either python datetime objects or as strings. The following are valid arguments.
>>> from datetime import datetime >>> dt = [datetime(2021, 1, 1), datetime(2021, 1, 2)] >>> dt = datetime(2021, 1, 1) >>> dt = ["2021-01-01T00:00:00", "2021-01-02T00:00:00"] >>> dt = "2021-01-01T00:00:00/2021-01-02T00:00:00" >>> dt = "2021-01-01T00:00:00"
Datetimes may also be passed as open intervals using double-dot notation.
>>> dt = "../2021-05-10T00:00:00" >>> dt = "2021-05-10T00:00:00/.."