STAC API#

Overview#

This notebook explains the use of the STAC API interface with GeoJSON response format. It uses the pystac [RD17] and pystac_client [RD18] libraries to access the interface. The visualisation of search results is borrowed from the ODC notebook available at [RD19]. Examples using curl on the command-line are provided as well.

URL_LANDING_PAGE = 'https://catalog.maap.eo.esa.int/catalogue/'

Access landing page#

The landing page provides access to collections (rel=”data”), child catalogs (rel=”child”) and the STAC item search endpoint (rel=”search”). Get the catalogue landing page with links to other resources and available collections.

curl -X GET -G https://catalog.maap.eo.esa.int/catalogue/
from pystac_client import Client 

api = Client.open(URL_LANDING_PAGE) 
# show as a dictionary
api.to_dict()
{'type': 'Catalog',
 'id': 'fedeo',
 'stac_version': '1.1.0',
 'description': 'MAAP Catalogue provides interoperable access, following ISO/OGC interface guidelines, to Earth Observation metadata',
 'links': [{'rel': 'self',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/',
   'type': 'application/json'},
  {'rel': 'search',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/api?httpAccept=application/opensearchdescription%2Bxml',
   'type': 'application/opensearchdescription+xml',
   'title': 'OpenSearch Description Document'},
  {'rel': 'service-desc',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/api?httpAccept=application/vnd.oai.openapi%2Bjson;version=3.0',
   'type': 'application/vnd.oai.openapi+json;version=3.0',
   'title': 'OpenAPI definition in JSON format'},
  {'rel': 'data',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/collections',
   'type': 'application/json',
   'title': 'Metadata about the feature collections'},
  {'rel': 'data',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/collections',
   'type': 'application/ld+json',
   'title': 'Metadata about the feature collections'},
  {'rel': 'data',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/collections',
   'type': 'application/rdf+xml',
   'title': 'Metadata about the feature collections'},
  {'rel': 'data',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/collections',
   'type': 'text/turtle',
   'title': 'Metadata about the feature collections'},
  {'rel': 'conformance',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/conformance',
   'type': 'application/json',
   'title': 'OGC conformance classes implemented by this API'},
  {'rel': 'service-doc',
   'href': 'https://catalog.maap.eo.esa.int/doc/index.html',
   'type': 'text/html',
   'title': 'API Documentation (Jupyter)'},
  {'rel': 'service-doc',
   'href': 'http://petstore.swagger.io/?url=https://catalog.maap.eo.esa.int/catalogue/api',
   'type': 'text/html',
   'title': 'API documentation in Swagger.io format'},
  {'rel': 'alternate',
   'href': 'https://catalog.maap.eo.esa.int/catalogue?httpAccept=text/html',
   'type': 'text/html',
   'title': 'Landing Page in HTML media type.'},
  {'rel': 'alternate',
   'href': 'https://catalog.maap.eo.esa.int/catalogue?httpAccept=application/ld%2Bjson',
   'type': 'application/ld+json',
   'title': 'Landing Page in JSON-LD media type.'},
  {'rel': 'search',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/search',
   'type': 'application/geo+json',
   'title': 'STAC Search',
   'method': 'GET'},
  {'rel': 'search',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/search',
   'type': 'application/geo+json',
   'title': 'STAC Search',
   'method': 'POST'},
  {'rel': 'child',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/series/eo:platform',
   'type': 'application/json',
   'title': 'Collections by platform'},
  {'rel': 'child',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/concepts/earthtopics',
   'type': 'application/json',
   'title': 'Earth Topics'},
  {'rel': 'child',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/concepts/instruments',
   'type': 'application/json',
   'title': 'ESA Instruments'},
  {'rel': 'child',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/concepts/platforms',
   'type': 'application/json',
   'title': 'ESA Platforms'},
  {'rel': 'child',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/series/eo:organisationName',
   'type': 'application/json',
   'title': 'Collections by organisation'},
  {'rel': 'root',
   'href': 'https://catalog.maap.eo.esa.int/catalogue/',
   'type': 'application/json',
   'title': 'MAAP Catalogue'}],
 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]},
  'temporal': {'interval': [[None, None]]}},
 'license': 'other',
 'conformsTo': ['http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core',
  'http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30',
  'http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson',
  'http://www.opengis.net/spec/ogcapi_common-2/1.0/conf/collections',
  'http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/simple-query',
  'http://www.opengis.net/spec/ogcapi-records-1/1.0/req/cql-filter',
  'http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter',
  'http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter',
  'https://api.stacspec.org/v1.0.0/core',
  'https://api.stacspec.org/v1.0.0/ogcapi-features',
  'https://api.stacspec.org/v1.0.0/collections',
  'https://api.stacspec.org/v1.0.0-rc.1/collection-search',
  'https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter',
  'https://api.stacspec.org/v1.0.0-rc.1/collection-search#free-text',
  'https://api.stacspec.org/v1.0.0/item-search',
  'https://api.stacspec.org/v1.0.0-rc.3/item-search#filter',
  'http://www.opengis.net/spec/cql2/1.0/conf/cql2-text',
  'http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2'],
 'title': 'MAAP Catalogue'}
# Get catalog title and description
print("Title\t\t:", api.title)
print("Description\t:", api.description)
print("Search link\t:", api.get_search_link())
Title		: MAAP Catalogue
Description	: MAAP Catalogue provides interoperable access, following ISO/OGC interface guidelines, to Earth Observation metadata
Search link	: <Link rel=search target=https://catalog.maap.eo.esa.int/catalogue/search>

Collection properties#

Collection identification#

# Use first collection from response

results = api.collection_search(    
    q = COLLECTION_ID6_MAAP
)

print(f"{results.matched()} collections found.")

data = results.collection_list_as_dict()
data = data['collections'][0]
1 collections found.
jstr = json.dumps(data, indent=3)
md("```json\n" + jstr + "\n```\n")
{
   "extent": {
      "spatial": {
         "bbox": [
            [
               -180,
               -90,
               180,
               90
            ]
         ]
      },
      "temporal": {
         "interval": [
            [
               "2024-07-31T00:00:00.000Z",
               null
            ]
         ]
      }
   },
   "stac_version": "1.0.0",
   "keywords": [
      "EARTH SCIENCE > BIOSPHERE > ECOSYSTEMS > TERRESTRIAL ECOSYSTEMS",
      "EARTH SCIENCE > AGRICULTURE > FOREST SCIENCE > AFFORESTATION/REFORESTATION",
      "Forestry",
      "Afforestation/Reforestation",
      "conditionsUnknown",
      "Imaging Radars",
      "Biomass",
      "P-SAR"
   ],
   "created": "2023-02-16T00:00:00.00Z",
   "description": "Biomass Level 1A Products",
   "collection": "EOP:ESA:MAAP",
   "type": "Collection",
   "title": "Biomass Level 1A",
   "license": "various",
   "assets": {
      "metadata_iso_19139": {
         "roles": [
            "metadata"
         ],
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/vnd.iso.19139%2Bxml",
         "title": "ISO 19139 metadata",
         "type": "application/vnd.iso.19139+xml"
      },
      "metadata_iso_19139_2": {
         "roles": [
            "metadata"
         ],
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/vnd.iso.19139-2%2Bxml",
         "title": "ISO 19139-2 metadata",
         "type": "application/vnd.iso.19139-2+xml"
      },
      "metadata_dif_10": {
         "roles": [
            "metadata"
         ],
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/dif10%2Bxml",
         "title": "DIF-10 metadata",
         "type": "application/dif10+xml"
      },
      "metadata_ogc_17_084r1": {
         "roles": [
            "metadata"
         ],
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?mode=owc",
         "title": "OGC 17-084r1 metadata",
         "type": "application/geo+json;profile=\"http://www.opengis.net/spec/eoc-geojson/1.0\""
      },
      "metadata_iso_191115_3": {
         "roles": [
            "metadata"
         ],
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/vnd.iso.19115-3%2Bxml",
         "title": "ISO 19115-3 metadata",
         "type": "application/vnd.iso.19115-3+xml"
      }
   },
   "links": [
      {
         "rel": "self",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a",
         "type": "application/json"
      },
      {
         "rel": "root",
         "href": "https://catalog.maap.eo.esa.int/catalogue/",
         "type": "application/json",
         "title": "MAAP Catalogue"
      },
      {
         "rel": "parent",
         "href": "https://catalog.maap.eo.esa.int/catalogue/",
         "title": "collections",
         "type": "application/json"
      },
      {
         "rel": "items",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/items?httpAccept=application/geo%2Bjson;profile=https://stacspec.org",
         "type": "application/geo+json",
         "title": "Datasets search for the series BiomassLevel1a"
      },
      {
         "rel": "http://www.opengis.net/def/rel/ogc/1.0/queryables",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/queryables",
         "type": "application/schema+json",
         "title": "Queryables for BiomassLevel1a"
      },
      {
         "rel": "license",
         "href": "https://earth.esa.int/eogateway/documents/d/earth-online/esa-eo-data-policy",
         "type": "application/x-binary",
         "title": "Access to and use of BIOMASS products are governed by the ESA's Data Policy and require acceptance of the specific Terms & Conditions. By accessing Biomass products, users inherently acknowledge and agree to these terms."
      },
      {
         "rel": "search",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/series/items/BiomassLevel1a/api",
         "type": "application/opensearchdescription+xml",
         "title": "OpenSearch Description Document"
      },
      {
         "rel": "describedby",
         "href": "https://esatellus.service-now.com/csp?id=esa_simple_request",
         "title": "Get Help? - ESA TellUS Help Page"
      },
      {
         "rel": "alternate",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?parentIdentifier=EOP:ESA:MAAP&httpAccept=application/atom%2Bxml",
         "type": "application/atom+xml",
         "title": "Atom format"
      },
      {
         "rel": "alternate",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?parentIdentifier=EOP:ESA:MAAP&httpAccept=application/ld%2Bjson",
         "type": "application/ld+json",
         "title": "JSON-LD metadata"
      },
      {
         "rel": "alternate",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?parentIdentifier=EOP:ESA:MAAP&httpAccept=application/ld%2Bjson;profile=https://schema.org",
         "type": "application/ld+json;profile=\"https://schema.org\"",
         "title": "JSON-LD (schema.org) metadata"
      },
      {
         "rel": "alternate",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?parentIdentifier=EOP:ESA:MAAP&httpAccept=application/ld%2Bjson;profile=http://data.europa.eu/930/",
         "type": "application/ld+json;profile=\"http://data.europa.eu/930/\"",
         "title": "JSON-LD (GeoDCAT-AP) metadata"
      },
      {
         "rel": "alternate",
         "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?parentIdentifier=EOP:ESA:MAAP&httpAccept=text/html",
         "type": "text/html",
         "title": "HTML"
      }
   ],
   "id": "BiomassLevel1a",
   "updated": "2023-02-16T00:00:00.00Z",
   "stac_extensions": [
      "https://stac-extensions.github.io/processing/v1.2.0/schema.json"
   ],
   "providers": [
      {
         "roles": [
            "producer"
         ],
         "name": "ESA/ESRIN",
         "url": "https://www.esa.int"
      },
      {
         "roles": [
            "host"
         ],
         "name": "MAAP Catalogue",
         "url": "https://catalog.maap.eo.esa.int/catalogue/"
      }
   ],
   "summaries": {
      "processing:level": [
         "L1A"
      ],
      "instruments": [
         "P-SAR"
      ],
      "platform": [
         "Biomass"
      ]
   }
}
# use stac_client class for STAC collection
c = Collection.from_dict(data)
print("id\t\t:", c.id)
print("title\t\t:", c.title)
print("description\t:", c.description)
print("keywords\t:", c.keywords)
print("spatial extent\t:", c.extent.spatial)
print("temporal extent\t:", c.extent.temporal)
id		: BiomassLevel1a
title		: Biomass Level 1A
description	: Biomass Level 1A Products
keywords	: ['EARTH SCIENCE > BIOSPHERE > ECOSYSTEMS > TERRESTRIAL ECOSYSTEMS', 'EARTH SCIENCE > AGRICULTURE > FOREST SCIENCE > AFFORESTATION/REFORESTATION', 'Forestry', 'Afforestation/Reforestation', 'conditionsUnknown', 'Imaging Radars', 'Biomass', 'P-SAR']
spatial extent	: <pystac.collection.SpatialExtent object at 0x000001ED7CDF1340>
temporal extent	: <pystac.collection.TemporalExtent object at 0x000001ED7CE6FD40>

The collection id (id) is to be used as collections parameter for a corresponding STAC item (granule) search. It can also be used in the ids parameter when searching collections by identifier.

Collection DOI#

Not all collections have a digital object identifier assigned. if they do, then it is available as sci:doi property. This value can be used for searching collections by DOI. Collections with DOI, typically also contain a link with rel=”cite-as” referring to their landing page.

try: 
    print(data['sci:doi'])
except:
    print("Not available")
Not available

Collection geometry#

Geometry information for a collection is included in the JSON response at the path $.extent.spatial.

data['extent']['spatial']
{'bbox': [[-180, -90, 180, 90]]}

Collection temporal extent#

The JSON response element provides temporal information for a collection, i.e. the start time and end time at the path $.extent.temporal. The end time may be absent indicating that the collection is not completed.

try: 
    print(data['extent']['temporal'])
except:
    print("Not available")
{'interval': [['2024-07-31T00:00:00.000Z', None]]}

Collection assets#

Collections provide access to a dictionary with assets. The roles attribute indicates the purpose of the asset. The href attribute provides the URL to access the asset. Collection assets may include thumbnail (when available), search interfaces, and various metadata formats.

The table below list some frequently used metadata formats and their corresponding media type (type).

Format

type

ISO19139

application/vnd.iso.19139+xml

ISO19139-2

application/vnd.iso.19139-2+xml

ISO19115-3

application/vnd.iso.19115-3+xml

ISO19157-2

application/vnd.iso.19157-2+xml

# Show assets of the collection (GeoJSON)
jstr = json.dumps(data['assets'], indent=3)
md("```json\n" + jstr + "\n```\n")
{
   "metadata_iso_19139": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/vnd.iso.19139%2Bxml",
      "title": "ISO 19139 metadata",
      "type": "application/vnd.iso.19139+xml"
   },
   "metadata_iso_19139_2": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/vnd.iso.19139-2%2Bxml",
      "title": "ISO 19139-2 metadata",
      "type": "application/vnd.iso.19139-2+xml"
   },
   "metadata_dif_10": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/dif10%2Bxml",
      "title": "DIF-10 metadata",
      "type": "application/dif10+xml"
   },
   "metadata_ogc_17_084r1": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?mode=owc",
      "title": "OGC 17-084r1 metadata",
      "type": "application/geo+json;profile=\"http://www.opengis.net/spec/eoc-geojson/1.0\""
   },
   "metadata_iso_191115_3": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a?httpAccept=application/vnd.iso.19115-3%2Bxml",
      "title": "ISO 19115-3 metadata",
      "type": "application/vnd.iso.19115-3+xml"
   }
}
# Display assets belonging to the collection
c = Collection.from_dict(data)
assets = c.assets
df = pd.DataFrame(columns=['roles', 'title', 'type'])
for key in assets:
    ndf = pd.DataFrame({ 
            'roles': assets[key].roles, 
            'type': assets[key].media_type, 
            'title': assets[key].title, 
            # 'href': assets[key].href  
        }, index = [0])
    df = pd.concat([df, ndf], ignore_index=True)
df
roles title type
0 metadata ISO 19139 metadata application/vnd.iso.19139+xml
1 metadata ISO 19139-2 metadata application/vnd.iso.19139-2+xml
2 metadata DIF-10 metadata application/dif10+xml
3 metadata OGC 17-084r1 metadata application/geo+json;profile="http://www.openg...
4 metadata ISO 19115-3 metadata application/vnd.iso.19115-3+xml

Granule properties#

Granules are returned via item links in the Catalog or Collection objects, or via the STAC API (Feature). An item is a GeoJSON Feature and the encoding is derived from the original OGC 17-003r2 encoding according to a documented mapping.

The properties available include attributes from STAC extensions as well:

Assets#

Granules provide access to a dictionary with assets. The roles attribute indicates the purpose of the asset. The href attribute provides the URL to access the asset. Granule assets include thumbnail (when available), a data download link (equivalent to the rel=enclosure), and various metadata formats.

The table below list some frequently used metadata formats and their corresponding media type (type).

Format

type

ISO19139

application/vnd.iso.19139+xml

ISO19139-2

application/vnd.iso.19139-2+xml

ISO19115-3

application/vnd.iso.19115-3+xml

OGC 10-157r4

application/gml+xml;profile=http://www.opengis.net/spec/EOMPOM/1.1

OGC 17-003r2

application/geo+json;profile=http://www.opengis.net/spec/eo-geojson/1.0

# Show assets of first search result (GeoJSON)
data = results.item_collection_as_dict()
jstr = json.dumps(data['features'][1]['assets'], indent=3)
md("```json\n" + jstr + "\n```\n")
{
   "quicklook_1": {
      "roles": [
         "overview"
      ],
      "href": "https://catalog.maap.eo.esa.int/data/biomass-pdgs-01/BiomassLevel1a/2017/01/10/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH/preview/bio_s2_scs__1s_20170110t222219_20170110t222240_i_g01_m01_c01_t011_f002_ql.png",
      "type": "image/png",
      "title": "preview"
   },
   "thumbnail": {
      "roles": [
         "thumbnail"
      ],
      "href": "https://catalog.maap.eo.esa.int/data/biomass-pdgs-01/BiomassLevel1a/2017/01/10/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH/public/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH.BI.PNG",
      "type": "image/png",
      "title": "Preview"
   },
   "product": {
      "file:local_path": "BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH.zip",
      "alternate:name": "HTTPS",
      "roles": [
         "data",
         "metadata",
         "archive"
      ],
      "href": "https://catalog.maap.eo.esa.int/data/zipper/biomass-pdgs-01/BiomassLevel1a/2017/01/10/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH",
      "auth:refs": [
         "oidc"
      ],
      "title": "Zipped product",
      "type": "application/zip"
   },
   "metadata_ogc_10_157r4": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/items/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH?httpAccept=application/gml%2Bxml&recordSchema=om",
      "title": "OGC 10-157r4 metadata",
      "type": "application/gml+xml;profile=\"http://www.opengis.net/spec/EOMPOM/1.1\""
   },
   "metadata_ogc_17_003r2": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/items/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH?mode=owc",
      "title": "OGC 17-003r2 metadata",
      "type": "application/geo+json;profile=\"http://www.opengis.net/spec/eo-geojson/1.0\""
   },
   "metadata_iso_19139": {
      "roles": [
         "metadata"
      ],
      "href": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/items/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH?httpAccept=application/vnd.iso.19139%2Bxml",
      "title": "ISO 19139 metadata",
      "type": "application/vnd.iso.19139+xml"
   },
   "quicklook": {
      "roles": [
         "overview"
      ],
      "href": "https://catalog.maap.eo.esa.int/data/biomass-pdgs-01/BiomassLevel1a/2017/01/10/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH/BIO_S2_SCS__1S_20170110T222219_20170110T222240_I_G01_M01_C01_T011_F002_01_CT15EH/preview/bio_s2_scs__1s_20170110t222219_20170110t222240_i_g01_m01_c01_t011_f002_map.kmz",
      "type": "application/vnd.google-earth.kmz",
      "title": "preview"
   }
}
df = pd.DataFrame(columns=['roles', 'title', 'type'])
    
# Display assets belonging to first item in results
for item in results.items():
    assets = item.assets
    for key in assets: 
        try: 
            ndf = pd.DataFrame({ 
                'roles': str(assets[key].roles), 
                'type': assets[key].media_type, 
                'title': assets[key].title, 
                # 'href': assets[key].href  
            }, index = [0])
            df = pd.concat([df, ndf], ignore_index=True)
        except:
            pass
    break
df
roles title type
0 ['overview'] preview image/png
1 ['thumbnail'] Preview image/png
2 ['data', 'metadata', 'archive'] Zipped product application/zip
3 ['metadata'] OGC 10-157r4 metadata application/gml+xml;profile="http://www.opengi...
4 ['metadata'] OGC 17-003r2 metadata application/geo+json;profile="http://www.openg...
5 ['metadata'] ISO 19139 metadata application/vnd.iso.19139+xml
6 ['overview'] preview application/vnd.google-earth.kmz

Advanced topics#

Conformance classes#

The conformance classes supported by the STAC interface are advertised in the conformsTo property of the landing page.

[
   "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core",
   "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30",
   "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson",
   "http://www.opengis.net/spec/ogcapi_common-2/1.0/conf/collections",
   "http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/simple-query",
   "http://www.opengis.net/spec/ogcapi-records-1/1.0/req/cql-filter",
   "http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter",
   "http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter",
   "https://api.stacspec.org/v1.0.0/core",
   "https://api.stacspec.org/v1.0.0/ogcapi-features",
   "https://api.stacspec.org/v1.0.0/collections",
   "https://api.stacspec.org/v1.0.0-rc.1/collection-search",
   "https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter",
   "https://api.stacspec.org/v1.0.0-rc.1/collection-search#free-text",
   "https://api.stacspec.org/v1.0.0/item-search",
   "https://api.stacspec.org/v1.0.0-rc.3/item-search#filter",
   "http://www.opengis.net/spec/cql2/1.0/conf/cql2-text",
   "http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2"
]

Additional search parameters#

Additional search parameters beyond the STAC search parameters can be used to filter collection search results. The available parameters for collection search are advertised at https://catalog.maap.eo.esa.int/catalogue/collections/queryables and represented as a JSON Schema.

URL_QUERYABLES = URL_LANDING_PAGE + 'collections/queryables'
curl -X GET -G https://catalog.maap.eo.esa.int/catalogue/collections/queryables
response = requests.get(URL_QUERYABLES)   
data = json.loads(response.text)    
df = pd.DataFrame(data['properties'].items(),columns=['key','value'])
df['type'] = df.apply(lambda row : row['value']['type'], axis = 1)
df['format'] = df.apply(lambda row : row['value']['format'] if 'format' in row['value'] else '-' , axis = 1)
df.drop('value',axis=1).sort_values(by=['key'])
key type format
12 classifiedAs string uri
11 doi string -
2 instrument string -
7 modificationDate string date-time
10 offering string -
6 organisationName string -
4 otherConstraint string -
1 parentIdentifier string -
5 platform string -
8 processingLevel string -
0 query string -
3 title string -
9 useLimitation string -
{
   "$schema": "https://json-schema.org/draft/2019-09/schema",
   "description": "Queryable names for the STAC API Collection Search filter.",
   "type": "object",
   "title": "Queryables for the STAC API",
   "properties": {
      "query": {
         "description": "{os:searchTerms}",
         "title": "Query",
         "type": "string"
      },
      "parentIdentifier": {
         "description": "{eo:parentIdentifier}",
         "title": "Parent identifier",
         "type": "string",
         "enum": [
            "EOP:ESA:EARTH-ONLINE",
            "EOP:ESA:MAAP",
            "EOP:EU:DATASPACE",
            "EOP:NASA:CMR",
            "EOP:STFC:CEDA-CCI"
         ]
      },
      "instrument": {
         "description": "{eo:instrument}",
         "title": "Instrument",
         "type": "string",
         "enum": [
            "AATSR",
            "ALADIN",
            "AMI/SAR",
            "ASAR",
            "ATLID",
            "ATSR-1",
            "ATSR-2",
            "AVHRR",
            "AVNIR-2",
            "BBR",
            "BGI",
            "CHRIS",
            "CPR",
            "Cameras",
            "EGG",
            "EOC",
            "ETM",
            "GEDI",
            "GIS",
            "GOME",
            "HRC",
            "HRG",
            "HRS",
            "HRV",
            "HRVIR",
            "HiRAIS",
            "HiRI",
            "Imaging Radars",
            "Imaging Spectrometers/Radiometers",
            "LISS-3",
            "MERIS",
            "MESSR",
            "MGM",
            "MIPAS",
            "MIRAS",
            "MSC",
            "MSI",
            "MSS",
            "MWR",
            "NAOMI",
            "OCM-2",
            "OLI",
            "OPS",
            "OSA",
            "P-SAR",
            "PALSAR",
            "PAN",
            "PAZ-SAR",
            "PRISM",
            "PlanetScope Camera",
            "RA",
            "RA-2",
            "RBV",
            "SAR",
            "SCIAMACHY",
            "SIRAL",
            "SLIM6",
            "SSTI",
            "STR",
            "SkySat Camera",
            "SpaceView-110",
            "TDX-1",
            "TIRS",
            "TM",
            "TSX-1",
            "VTIR",
            "WV110",
            "WV60",
            "X-SAR"
         ]
      },
      "title": {
         "description": "{dc:title}",
         "title": "Title",
         "type": "string"
      },
      "otherConstraint": {
         "description": "{eo:otherConstraint}",
         "title": "Other constraint",
         "type": "string"
      },
      "platform": {
         "description": "{eo:platform}",
         "title": "Platform",
         "type": "string",
         "enum": [
            "ALOS-1",
            "Aeolus",
            "Beijing-1",
            "Biomass",
            "COSMO-SkyMed",
            "CryoSat-2",
            "ERS-1",
            "ERS-2",
            "EarthCARE",
            "Envisat",
            "GEOSAT-1",
            "GEOSAT-2",
            "GOCE",
            "GeoEye-1",
            "ICESat-2",
            "ICEYE",
            "IKONOS-2",
            "IRS-1C",
            "IRS-1D",
            "IRS-P5",
            "IRS-P6",
            "ISS",
            "JERS-1",
            "KOMPSAT-1",
            "KOMPSAT-2",
            "Landsat-1",
            "Landsat-2",
            "Landsat-3",
            "Landsat-4",
            "Landsat-5",
            "Landsat-7",
            "Landsat-8",
            "MOS-1A",
            "MOS-1B",
            "Metop-A",
            "Metop-B",
            "NOAA POES",
            "NigeriaSat-1",
            "OceanSat-2",
            "PAZ",
            "PROBA-1",
            "PlanetScope",
            "Pleiades",
            "QuickBird-2",
            "RADARSAT-1",
            "RapidEye",
            "SMOS",
            "SPOT 1",
            "SPOT 2",
            "SPOT 3",
            "SPOT 4",
            "SPOT 5",
            "SPOT 6",
            "SPOT 7",
            "Seasat",
            "Sentinel-1",
            "Sentinel-2",
            "SkySat",
            "TanDEM-X",
            "TerraSAR-X",
            "UAV",
            "UK-DMC-1",
            "WorldView-1",
            "WorldView-2",
            "WorldView-3",
            "WorldView-4"
         ]
      },
      "organisationName": {
         "description": "{eo:organisationName}",
         "title": "Organisation name",
         "type": "string",
         "enum": [
            "CEDA",
            "CMR",
            "ESA/ESRIN",
            "NASA NSIDC DAAC",
            "ORNL_DAAC"
         ]
      },
      "modificationDate": {
         "format": "date-time",
         "description": "{eo:modificationDate}",
         "title": "Modification date",
         "type": "string"
      },
      "processingLevel": {
         "description": "{eo:processingLevel}",
         "title": "Processing level",
         "type": "string",
         "enum": [
            "1a",
            "level 0",
            "level 1",
            "level 1.5",
            "level 1a",
            "level 1b",
            "level 1c",
            "level 1d",
            "level 1g",
            "level 1gt",
            "level 1r",
            "level 1t",
            "level 2",
            "level 2a",
            "level 2b",
            "level 2c",
            "level 3",
            "level 3a",
            "level 3b",
            "level 4",
            "multiple"
         ]
      },
      "useLimitation": {
         "description": "{eo:useLimitation}",
         "title": "Use limitation",
         "type": "string",
         "enum": [
            "access to and use of biomass products are governed by the esa's data policy and require acceptance of the specific terms & conditions. by accessing biomass products, users inherently acknowledge and agree to these terms.",
            "data service request",
            "eo sign in authentication (open)",
            "eo sign in authentication",
            "fast registration with approval (restrained)",
            "fast registration with approval",
            "fast registration with immediate access",
            "license url for data use policy https://science.nasa.gov/earth-science/earth-science-data/data-information-policy",
            "license url for data use policy https://www.earthdata.nasa.gov/engage/open-data-services-software-policies/data-use-guidance",
            "open access",
            "project proposal (restrained)",
            "restrained data",
            "under the following licence https://artefacts.ceda.ac.uk/licences/specific_licences/esacci_biomass_terms_and_conditions_v2.pdf, appropriate use of these data may fall under any use. this message is intended as guidance, always read the full licence. when using these data you must cite them correctly using the citation given on the ceda data catalogue record. https://artefacts.ceda.ac.uk/licences/specific_licences/esacci_biomass_terms_and_conditions_v2.pdf",
            "utilisation of this data is subject to esa's earth observation terms and conditions https://earth.esa.int/eogateway/documents/20142/1560778/esa-third-party-missions-terms-and-conditions.pdf"
         ]
      },
      "offering": {
         "description": "{eo:offering}",
         "title": "Offering",
         "type": "string",
         "enum": [
            "describecoverage",
            "getcapabilities",
            "getcoverage",
            "getmap",
            "wcs",
            "wms"
         ]
      },
      "doi": {
         "description": "{eo:doi}",
         "title": "Doi",
         "type": "string",
         "enum": [
            "10.3334/ornldaac/1577",
            "10.3334/ornldaac/1923",
            "10.3334/ornldaac/1952",
            "10.3334/ornldaac/2028",
            "10.3334/ornldaac/2056",
            "10.3334/ornldaac/2180",
            "10.3334/ornldaac/2186",
            "10.3334/ornldaac/2236",
            "10.3334/ornldaac/2251",
            "10.3334/ornldaac/2294",
            "10.3334/ornldaac/2298",
            "10.3334/ornldaac/2321",
            "10.3334/ornldaac/2338",
            "10.3334/ornldaac/2339",
            "10.5270/al1-5e400fd",
            "10.5270/al1-a06d3ac",
            "10.5270/al1-b459f4e",
            "10.5270/al1-d9cfa6d",
            "10.5270/al1-d9d4874",
            "10.5270/avh-f1i8784",
            "10.5270/cr2-120cf4c",
            "10.5270/dm1-w9tup3r",
            "10.5270/en1-4c37krv",
            "10.5270/en1-61d6y63",
            "10.5270/en1-77pi5sd",
            "10.5270/en1-88oasur",
            "10.5270/en1-a1rc3jf",
            "10.5270/en1-c8hgqx4",
            "10.5270/en1-cu4a5e3",
            "10.5270/en1-d9ryw7t",
            "10.5270/en1-eqvj8vs",
            "10.5270/en1-opsw96m",
            "10.5270/en1-q74d24h",
            "10.5270/en1-ttqbj6p",
            "10.5270/en1-u55aesn",
            "10.5270/en1-ueksx4q",
            "10.5270/en1-vqoj1gs",
            "10.5270/en1-w5xkqmx",
            "10.5270/en1-x542no0",
            "10.5270/ers-0p2cu8d",
            "10.5270/ers-7c3qhyo",
            "10.5270/ers-suu0xfp",
            "10.5270/esa-02d6cbf",
            "10.5270/esa-2d07033",
            "10.5270/esa-2eb13ab",
            "10.5270/esa-4427c33",
            "10.5270/esa-6mxo3sr",
            "10.5270/esa-79a176b",
            "10.5270/esa-7c37033",
            "10.5270/esa-7nc8pjp",
            "10.5270/esa-852456e",
            "10.5270/esa-86e26dc",
            "10.5270/esa-8sfucze",
            "10.5270/esa-8xb8scs",
            "10.5270/esa-a36265c",
            "10.5270/esa-a681fe7",
            "10.5270/esa-c26d993",
            "10.5270/esa-d69ulft",
            "10.5270/esa-e3e68ff",
            "10.5270/esa-ht6sxz7",
            "10.5270/esa-iboli84",
            "10.5270/esa-j340roh",
            "10.5270/esa-jfhe2um",
            "10.5270/esa-l8g67jw",
            "10.5270/esa-otce9j2",
            "10.5270/esa-qoe849q",
            "10.5270/ik2-5dwhs28",
            "10.5270/je1-408s1ur",
            "10.5270/je1-64xxf7c",
            "10.5270/je1-cerzmcu",
            "10.5270/ko2-2ijzzay",
            "10.5270/qb2-ftu9xmh",
            "10.5270/se1-99j66hv",
            "10.5285/bf535053562141c6bb7ad831f5998d77",
            "10.57780/al1-36b29e9",
            "10.57780/al1-5f3877f",
            "10.57780/en1-2d5de29",
            "10.57780/esa-38f62f7",
            "10.57780/esa-5018efb",
            "10.57780/esa-53b8e3f",
            "10.57780/esa-6fc121d",
            "10.57780/esa-80e19f0",
            "10.57780/esa-b667eb7",
            "10.57780/esa-c9d5673",
            "10.57780/sm1-4f787c3",
            "10.57780/sm1-5ebe10b",
            "10.57780/sm1-857c3d7 10.57780/sm1-e20cf57 10.57780/sm1-294cb1b",
            "10.57780/sm1-fbf89e0"
         ]
      },
      "classifiedAs": {
         "format": "uri",
         "description": "{semantic:classifiedAs}",
         "title": "Classified as",
         "type": "string"
      }
   },
   "$id": "https://catalog.maap.eo.esa.int/catalogue/collections/queryables"
}

Additional search parameters beyond the STAC search parameters can be used to filter granule search results. The available parameters for granule search are advertised for each individual collection and represented as a JSON Schema.

For example, the collection BiomassLevel1a, advertises its search parameters at https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/queryables in JSON Schema format. Therefore, the following parameters can be used within a filter expression.

Get filter parameters for granule search

curl -X GET -G https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/queryables
key type format
1 acquisitionType string -
14 antennaLookDirection string -
12 completionTimeFromAscendingNode number -
20 dataTakeID integer -
27 frame string -
23 globalCoverageID string -
3 instrument string -
5 majorCycleID string -
17 missionPhase string -
22 modificationDate string date-time
26 orbitDirection string -
6 orbitNumber integer -
4 platform string -
16 polarisationChannels string -
0 polarisationMode string -
21 processingCenter string -
2 processingDate string date-time
8 processingLevel string -
24 processingMode string -
10 processorName string -
15 productType string -
7 productVersion string -
9 productionStatus string -
18 repeatCycleID string -
25 sensorMode string -
11 startTimeFromAscendingNode number -
19 swathIdentifier string -
13 track string -
{
   "$schema": "https://json-schema.org/draft/2019-09/schema",
   "description": "Queryable names for the STAC API Item Search filter.",
   "type": "object",
   "title": "Queryables for BiomassLevel1a collection",
   "properties": {
      "polarisationMode": {
         "description": "{eo:polarisationMode}",
         "title": "Polarisation mode",
         "type": "string",
         "enum": [
            "Q"
         ]
      },
      "acquisitionType": {
         "description": "{eo:acquisitionType}",
         "title": "Acquisition type",
         "type": "string",
         "enum": [
            "NOMINAL"
         ]
      },
      "processingDate": {
         "format": "date-time",
         "description": "{eo:processingDate}",
         "title": "Processing date",
         "type": "string"
      },
      "instrument": {
         "description": "{eo:instrument}",
         "title": "Instrument",
         "type": "string",
         "enum": [
            "P-SAR"
         ]
      },
      "platform": {
         "description": "{eo:platform}",
         "title": "Platform",
         "type": "string",
         "enum": [
            "Biomass"
         ]
      },
      "majorCycleID": {
         "description": "{eocat:majorCycleID}",
         "title": "Major cycle id",
         "type": "string",
         "enum": [
            "1",
            "2",
            "3",
            "4",
            "5",
            "6",
            "7"
         ]
      },
      "orbitNumber": {
         "description": "{eo:orbitNumber}",
         "title": "Orbit number",
         "type": "integer"
      },
      "productVersion": {
         "description": "{eo:productVersion}",
         "title": "Product version",
         "type": "string",
         "enum": [
            "01"
         ]
      },
      "processingLevel": {
         "description": "{eo:processingLevel}",
         "title": "Processing level",
         "type": "string",
         "enum": [
            "1A"
         ]
      },
      "productionStatus": {
         "description": "{eo:productionStatus}",
         "title": "Production status",
         "type": "string",
         "enum": [
            "ARCHIVED"
         ]
      },
      "processorName": {
         "description": "{eo:processorName}",
         "title": "Processor name",
         "type": "string",
         "enum": [
            "Biomass L1 Processor"
         ]
      },
      "startTimeFromAscendingNode": {
         "description": "{eo:startTimeFromAscendingNode}",
         "title": "Start time from ascending node",
         "type": "number"
      },
      "completionTimeFromAscendingNode": {
         "description": "{eo:completionTimeFromAscendingNode}",
         "title": "Completion time from ascending node",
         "type": "number"
      },
      "track": {
         "description": "{eo:track}",
         "title": "Track",
         "type": "string"
      },
      "antennaLookDirection": {
         "description": "{eo:antennaLookDirection}",
         "title": "Antenna look direction",
         "type": "string",
         "enum": [
            "LEFT",
            "RIGHT"
         ]
      },
      "productType": {
         "description": "{eo:productType}",
         "title": "Product type",
         "type": "string",
         "enum": [
            "S1_SCS__1M",
            "S1_SCS__1S",
            "S2_SCS__1M",
            "S2_SCS__1S",
            "S3_SCS__1M",
            "S3_SCS__1S"
         ]
      },
      "polarisationChannels": {
         "description": "{eo:polarisationChannels}",
         "title": "Polarisation channels",
         "type": "string",
         "enum": [
            "HH, HV, VH, VV"
         ]
      },
      "missionPhase": {
         "description": "{eocat:missionPhase}",
         "title": "Mission phase",
         "type": "string",
         "enum": [
            "INTERFEROMETRIC"
         ]
      },
      "repeatCycleID": {
         "description": "{eocat:repeatCycleID}",
         "title": "Repeat cycle id",
         "type": "string",
         "enum": [
            "1",
            "2",
            "3"
         ]
      },
      "swathIdentifier": {
         "description": "{eo:swathIdentifier}",
         "title": "Swath identifier",
         "type": "string",
         "enum": [
            "S1",
            "S2",
            "S3"
         ]
      },
      "dataTakeID": {
         "description": "{eocat:dataTakeID}",
         "title": "Data take id",
         "type": "integer"
      },
      "processingCenter": {
         "description": "{eo:processingCenter}",
         "title": "Processing center",
         "type": "string",
         "enum": [
            "Biomass CPF"
         ]
      },
      "modificationDate": {
         "format": "date-time",
         "description": "{eo:modificationDate}",
         "title": "Modification date",
         "type": "string"
      },
      "globalCoverageID": {
         "description": "{eocat:globalCoverageID}",
         "title": "Global coverage id",
         "type": "string",
         "enum": [
            "1"
         ]
      },
      "processingMode": {
         "description": "{eo:processingMode}",
         "title": "Processing mode",
         "type": "string",
         "enum": [
            "OPERATIONAL"
         ]
      },
      "sensorMode": {
         "description": "{eo:sensorMode}",
         "title": "Sensor mode",
         "type": "string",
         "enum": [
            "SM"
         ]
      },
      "orbitDirection": {
         "description": "{eo:orbitDirection}",
         "title": "Orbit direction",
         "type": "string",
         "enum": [
            "ASCENDING",
            "DESCENDING"
         ]
      },
      "frame": {
         "description": "{eo:frame}",
         "title": "Frame",
         "type": "string"
      }
   },
   "$id": "https://catalog.maap.eo.esa.int/catalogue/collections/BiomassLevel1a/queryables"
}

CQL filter expressions#

The STAC interface supports the filter parameter and filter expressions in cql-text filter format at the following endpoints:

  • /collections

  • /collections/{collection-id}/items

  • /search

At the /search endpoint, it is required that a single collection can be determined from the collections or ids parameter. The queryables allowed in the filter expression are then identical to the ones at the corresponding /collections/{collection-id}/items/queryables endpoint. filter cannot be used at the /search endpoint when collections contains 0 or more than 1 collection identifiers.

Filter expressions are to be expressed with the Text encoding of the Basic Common Query Language (Basic CQL2-Text) [RD22]. See the OGC API Features “Conformance class Filter” section for CQL2 examples.

Example: 8.1

CQL Filter for collection search with logical operators (and, or).

filter = "platform = 'Envisat' and ( instrument = 'MERIS' or instrument = 'MIPAS' ) and organisationName = 'ESA/ESRIN'"

results = api.collection_search(   
    filter = filter
)
curl -X GET -G https://catalog.maap.eo.esa.int/catalogue/collections \
	--data-urlencode "filter=platform = 'Envisat' and ( instrument = 'MERIS' or instrument = 'MIPAS' ) and organisationName = 'ESA/ESRIN'" \
	--data-urlencode "filter-lang=cql2-text"
data = results.collection_list_as_dict()
df = pd.json_normalize(data, record_path=['collections'])

df[['id', 'title']]
id title
0 MER.RR__2P Envisat MERIS Reduced Resolution Geophysical P...
1 MER_FRS_2P Envisat MERIS Full Resolution - Level 2 [MER_F...
2 ENVISAT.MIP.NL__2P Envisat MIPAS L2 - Temperature, pressure and a...
3 MER.RR__1P Envisat MERIS Reduced Resolution - Level 1 [ME...
4 MER_FRS_1P Envisat MERIS Full Resolution - Level 1 [MER_F...
5 ENVISAT.MIP.NL__1P Envisat MIPAS L1 - Geo-located and calibrated ...

Example: 8.2

CQL filter for granule search with comparison operators. Search granules with cloudCover between 10 and 15%.

from pystac_client import Client 
api = Client.open(URL_LANDING_PAGE)  

results = api.search(
    method = 'GET',   
    max_items = 30,
    collections = [COLLECTION_ID3_CLOUDS],
    filter = "cloudCover >= 10 and cloudCover < 15"   
)
curl -X GET -G https://catalog.maap.eo.esa.int/catalogue/search \
	--data-urlencode "collections=IKONOS.ESA.archive" \
	--data-urlencode "filter=cloudCover >= 10 and cloudCover < 15" \
	--data-urlencode "filter-lang=cql2-text"
print(f"{results.matched()} items found.")
26 items found.
# Display cloud-cover values as histogram to show that range is taken into account
stac_json = results.item_collection_as_dict()
gdf = gpd.GeoDataFrame.from_features(stac_json)
try:
  _ = gdf[['title','eo:cloud_cover']].hist()
except:
  print("eo:cloud_cover information is not available.")
_images/6bf20967f35f17bd43acf61d8189b95c6362bd5ec6822f719f580f5f99a40cdd.png

Further Reading#