Finding Data / Collections
This library is primarily designed for downloading purposes. The most convenient way to explore data is typically through the website of the data provider, where they often offer interactive data exploration. Their websites are linked in the README and in Demos. However, you can also obtain some basic information about the collections through our library. Here, we will focus on the Planetary Computer; other data backends will follow a similar structure, if supported.
[1]:
from utils import list_of_dicts_to_tree
import terragon
tg = terragon.init("pc") # credentials are not needed for public datasets
The meta data and the collections can be filtered by a query with format : with a regular expression. Additional, one can filter by the returned fields.
[2]:
collections = tg.retrieve_collections(
query={"id": ".*climate.*"}, fields=["id", "title", "keywords"]
)
list_of_dicts_to_tree(collections, "id")
[2]:
Typically a field also includes the licences of the collections.
[3]:
# find collection with id containing sentinel.1
collections = tg.retrieve_collections(query={"id": ".*sentinel.1.*"}, fields=["id", "license"])
list_of_dicts_to_tree(collections, "id")
[3]:
Other examples
[4]:
# title needs to contain burned and return the assets
collections = tg.retrieve_collections(
query={"title": "burned"}, fields=["id", "title", "keywords", "extend", "item_assets"]
)
list_of_dicts_to_tree(collections, "id")
[4]:
[5]:
# fire needs to be in the keywords
collections = tg.retrieve_collections(
query={"keywords": ".*fire.*"}, fields=["id", "title", "keywords"]
)
list_of_dicts_to_tree(collections, "id")
[5]:
[6]:
# description contains both sentinel-1 and sentinel-2
collections = tg.retrieve_collections(
query={"description": "(?=.*sentinel-1)(?=.*sentinel-2)"}, fields=["id", "title", "keywords"]
)
list_of_dicts_to_tree(collections, "id")
[6]: