API
The section shows information about the API relevant for the developers.
Extractors
eodm.extract.extract_stac_api_items(url, collections=None, bbox=None, datetime_interval=None, limit=None, query=None, filter=None)
Extracts STAC Items from a STAC API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Link to STAC API endpoint |
required |
collections |
list[str] | None
|
List of collections to extract items from. Defaults to None. |
None
|
bbox |
tuple[float, float, float, float] | None
|
Bounding box to search. Defaults to None. |
None
|
datetime_interval |
str | None
|
Datetime interval to search. Defaults to None. |
None
|
limit |
int
|
Limit query to given number. Defaults to 10. |
None
|
query |
optional
|
STACAPI Query extension |
None
|
filter |
optional
|
STACAPI CQL Filter extension |
None
|
Yields:
Type | Description |
---|---|
Item
|
Iterator[Item]: pystac Items |
Source code in src/eodm/extract.py
eodm.extract.extract_stac_api_collections(url)
Extracts STAC Collections from a STAC API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Link to STAC API endpoint |
required |
Yields:
Type | Description |
---|---|
Collection
|
Iterator[Collection]: pystac Collections |
Source code in src/eodm/extract.py
eodm.extract.extract_opensearch_features(url, product_types, limit=0)
Extracts OpenSearch Features from an OpenSearch API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Link to OpenSearch API endpoint |
required |
productTypes |
list[str]
|
List of productTypes to search for |
required |
Yields:
Type | Description |
---|---|
OpenSearchFeature
|
Iterator[OpenSearchFeature]: OpenSearch Features |
Source code in src/eodm/extract.py
Loaders
eodm.load.load_stac_api_items(url, items, headers=None, verify=True, update=False, skip_existing=False)
Load multiple items into a STAC API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
STAC API url |
required |
items |
Iterable[Item]
|
A collection of STAC Items |
required |
headers |
dict[str, str] | None
|
Headers to add to the request. Defaults to None. |
None
|
verify |
bool
|
Verify SSL request. Defaults to True. |
True
|
update |
bool
|
Update STAC Item with new content. Defaults to False. |
False
|
skip_existing |
bool
|
Skip Item if exists. Defaults to False. |
False
|
Source code in src/eodm/load.py
eodm.load.load_stac_api_collections(url, collections, headers=None, verify=True, update=False, skip_existing=False)
Load multiple collections to a stac API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
STAC API URL |
required |
collections |
Iterable[Collection]
|
A collection of STAC Collections |
required |
headers |
dict[str, str] | None
|
Additional headers to send. Defaults to None. |
None
|
verify |
bool
|
Verify TLS request. Defaults to True. |
True
|
update |
bool
|
Update the destination Collections. Defaults to False. |
False
|
skip_existing |
bool
|
Skip existing Collections. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Iterable[Collection]
|
Iterable[Collection]: |
Source code in src/eodm/load.py
Opensearch
eodm.opensearch.OpenSearchClient(describe_url)
Source code in src/eodm/opensearch.py
NS = {'': 'http://www.w3.org/2005/Atom', 'opensearch': 'http://a9.com/-/spec/opensearch/1.1/', 'parameters': 'http://a9.com/-/spec/opensearch/extensions/parameters/1.0/', 'georss': 'http://www.georss.org/georss/', 'media': 'http://search.yahoo.com/mrss/', 'owc': 'http://www.opengis.net/owc/1.0/', 'eo': 'http://a9.com/-/opensearch/extensions/eo/1.0/', 'geo': 'http://a9.com/-/opensearch/extensions/geo/1.0/', 'time': 'http://a9.com/-/opensearch/extensions/time/1.0/', 'cql': 'http://a9.com/-/opensearch/extensions/cql/1.0/', 'dc': 'http://purl.org/dc/elements/1.1/'}
class-attribute
instance-attribute
describe_url = describe_url
instance-attribute
metadata: OpenSearchMetadata
cached
property
Service level metadata
query_urls: list[OpenSearchUrl]
cached
property
List of OpenSearchUrl query objects. Can be used for constructing a query
search(query, mimetype='application/json')
Search for features in the OpenSearch service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
dict[str, Any]
|
Query parameters to search for.
The keys should match the parameter names in the OpenSearch service and
have the format |
required |
mimetype |
str
|
Mimetype. |
'application/json'
|
Yields:
Type | Description |
---|---|
OpenSearchFeature
|
Iterator[OpenSearchFeature]: Iterator of OpenSearchFeature object |
Source code in src/eodm/opensearch.py
eodm.opensearch.OpenSearchFeature
eodm.opensearch.OpenSearchUrl
Bases: BaseModel
parameters: dict[str, OpenSearchParameter]
instance-attribute
template_url: str
instance-attribute
type: str
instance-attribute
Serializers
eodm.serializers
Mappable
Bases: Protocol
to_dict()
Source code in src/eodm/serializers.py
default_serializer(items)
Serializes a list of Mappables (implementing to_dict()) to json strings individually
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Iterable[Mappable]
|
A collection of Mappable items |
required |
Returns:
Type | Description |
---|---|
Iterable[str]
|
Iterable[str]: item as a string |
Yields:
Type | Description |
---|---|
Iterable[str]
|
Iterator[Iterable[str]]: Collection of json strings |
Source code in src/eodm/serializers.py
json_serializer(items)
Serializes a list of Mappables (implementing to_dict()) to a json list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Iterable[Mappable]
|
A collection of Mappable items |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
items as a json list |
Source code in src/eodm/serializers.py
STAC Contributions
eodm.stac_contrib
FSSpecStacIO
Bases: StacIO
Extension of StacIO to allow working with different filesystems in STAC using fsspec.
More information: https://pystac.readthedocs.io/en/stable/concepts.html#i-o-in-pystac