STAC
Some of the L1 satellite images, used to detect hotspots and burnt areas, are available via a STAC API. The root URL to access the offered STAC API is documented in the respective REST API section.
Users can search for satellite imagery for given spatial and temporal extents, for example for OroraTech's FOREST satellites.
REST API invocations must be authenticated using a personal API key.
Python Quick start
The following Python guide demonstrates how to retrieve data from the STAC API using the pystac-client in Python3.
Install the required packages inside your working folder:
pip install pystac-client requests
Collections
To retrieve the available collections:
from pystac_client import Client
headers = {"apikey": "YOUR_API_KEY"} # Replace with your API key
catalog = Client.open("https://app.ororatech.com/v1/stac/", headers=headers)
# Retrieve collections
for collection in catalog.get_collections():
print(collection)
The client object may be freely used to search for items within any collection.
Search
To search for FOREST-2 satellite imagery for a specific date:
search = catalog.search(
max_items=10,
collections=["FOREST-2"],
datetime=[
"2024-02-15",
"2024-02-17",
], # Searches for products between 2024-02-15 and 2024-02-17
)
print(f"{search.matched()} items found")
for item in search.items():
print(item.id, item.datetime)
for band, asset in item.get_assets().items():
print(band, asset.href)
Item assets are split into bands, for example LWIR1, LWIR2, MWIR.
The href attribute contains the URL to download the GeoTIFF file for the respective band.
Spatio-temporal filter
The search can be further refined by adding a bounding box to the query:
search = catalog.search(
max_items=10,
collections=["FOREST-2"],
datetime=["2024-02-15", "2024-02-17"],
bbox=[-180, -90, 180, 90], # Searches for products within the entire world
)
or by passing an arbitrary geometry in GeoJSON format:
search = catalog.search(
max_items=10,
datetime=["2024-02-15", "2024-02-17"],
intersects={
"type": "Polygon",
"coordinates": [
[
[6.42425537109375, 53.174765470134616],
[7.344360351562499, 53.174765470134616],
[7.344360351562499, 53.67393435835391],
[6.42425537109375, 53.67393435835391],
[6.42425537109375, 53.174765470134616],
]
],
},
)
Download assets
All GeoTIFF files are offered in COGEO format, which allows to efficiently access the data.
import requests
from pystac_client import Client
headers = {"apikey": "YOUR_API_KEY"} # Replace with your API key
catalog = Client.open("https://app.ororatech.com/v1/stac/", headers=headers)
# search by specific item identifier
item_id = "F002_L1__IR__L2L1M0__2024-02-17T072743.034550Z_2024-02-20T080840.049673Z_12541177_1708416811.880603_DG-Img2Map-IR1_0.2.1_db233f333b94079a"
search = catalog.search(
ids=[item_id],
)
item = search.item_collection()[0] # retrieve first result of search
asset = item.get_assets()["MWIR"] # retrieve MWIR band asset
r = requests.get(
asset.href, headers={"apikey": "YOUR_API_KEY"}, stream=True
) # download the asset
if r.status_code != 200:
raise Exception("Asset not found!")
# download tif file
with open(f"{item_id}.tif", "wb") as f:
for chunk in r.iter_content(chunk_size=1024):
f.write(chunk)
Advanced libraries, such as rasterio or xarray, can be used to read and process specific parts of the COGEO file directly, without having to download the entire file.
Advanced usage
To utilize the full potential of the STAC API, refer to the pystac-client documentation.