STAC usage

Search and retrieve geospatial data via STAC-compliant API endpoints.

Overview

SpatioTemporal Asset Catalog (STAC) is a specification designed to establish a standard in geospatial data. It allows searching across multiple providers for geospatial assets which share a common structure and set of metadata.

The following UP42 APIs support the STAC specification:

Catalog

Catalog API allows you to search for and preview catalog scenes.

Catalog API

Data management

Data management API allows you to search for data in your storage.

Data management API

STAC objects

STAC objectDescriptionAPI object in UP42โ€™s catalogAPI object in UP42โ€™s storage
STAC catalogThe starting point for navigating STAC, a top-level landing page that provides a linking structure for grouping other STAC objects. No mapped object inline-icon-large No mapped object inline-icon-large
STAC collectionA STAC object that groups related STAC items and aggregates their summary metadata.Catalog collectionA group of data items from the same delivery
STAC itemAn individual scene in a STAC collection that has a unique spatiotemporal extent. Different spatiotemporal extents produce different STAC items.SceneData item
STAC assetA geospatial feature of a STAC item, its mask, preview, or metadata file.PreviewAsset
STAC extensionA JSON schema with additional parameters available for a specific STAC object. Extensions differ based on data availability, sensor, and constellation. No mapped object inline-icon-large No mapped object inline-icon-large

Common Query Language (CQL2) is a filter grammar that can be used to search for STAC items. A CQL2 filter consists of rules, while rules consist of arguments and operators.

ParameterOverview
filter

object

A CQL2 filter.

filter.args

array of objects

Arguments inside of a CQL2 filter. An argument is the value corresponding to a particular property chosen from the supported filter parameters:

filter.opstring
Operators inside of a CQL2 filter.

An example of a filter that searches for STAC items with cloud coverage less than 20%:

JSON
{
"filter": {
"op": "<",
"args": [
{
"property": "eo:cloud_cover"
},
20.0
]
}
}

Operators

Arithmetic operators

Available for Data management

  • +: Addition
  • -: Subtraction
  • *: Multiplication
  • /: Division

Array operators

Available for Data management

  • a_contains: Search for STAC items that contain all array values in their parameters.
  • a_overlaps: Search for STAC items that contain at least one array value in their parameters.

An example with a_contains: return items with both optical and aerial in their tags

JSON
{
"filter": {
"op": "a_contains",
"args": [
{
"property": "tags"
},
["optical", "aerial"]
]
}
}

An example with a_overlaps: return items with either 'optical' or 'aerial' in their tags

JSON
{
"filter": {
"op": "a_overlaps",
"args": [
{
"property": "tags"
},
["optical", "aerial"]
]
}
}

Comparison operators

Available for Catalog Data management

  • =: Equal to
  • !=: Not equal to
  • <: Less than
  • >: Greater than
  • <=: Less than or equal to
  • >=: Greater than or equal to
  • isNull: The value is null
  • in: The value matches any value in a list (in the catalog, up to 100 values)
  • like: The text value matches a pattern (% for any number of characters)

An example with =: return items associated with a specific order ID

JSON
{
"filter": {
"op": "=",
"args": [
{
"property": "order_id"
},
"b9fc2b75-f9de-46dd-a21b-320381bbb62d"
]
}
}

An example with <>: return items with data product IDs that don't match the specified one

JSON
{
"filter": {
"op": "<>",
"args": [
{
"property": "data_product_id"
},
"b0e4a80e-6a54-486c-ac0c-44497b602545"
]
}
}

An example with <: return items created before June 27, 2023

JSON
{
"filter": {
"op": "<",
"args": [
{
"property": "created"
},
{
"timestamp": "2023-06-27T00:00:00.000Z"
}
]
}
}

An example with >: return items with cloud coverage greater than 20%

JSON
{
"filter": {
"op": ">",
"args": [
{
"property": "eo:cloud_cover"
},
20.0
]
}
}

An example with <=: return items with a datetime on or before June 27, 2023

JSON
{
"filter": {
"op": "<=",
"args": [
{
"property": "datetime"
},
{
"timestamp": "2023-06-27T00:00:00.000Z"
}
]
}
}

An example with >=: return items with a ground sample distance (GSD) of 57 cm or more

JSON
{
"filter": {
"op": ">=",
"args": [
{
"property": "gsd"
},
0.57
]
}
}

An example with in: return items with the OPTICAL or SAR product type

JSON
{
"filter": {
"op": "in",
"args": [
{
"property": "product:type"
},
["OPTICAL", "SAR"]
]
}
}

An example with like: return items from collections whose names start with 'pneo-'

JSON
{
"filter": {
"op": "like",
"args": [
{
"property": "collection"
},
"pneo-%"
]
}
}

An example with isNull: return items with no tags

JSON
{
"filter": {
"op": "isNull",
"args": {
"property": "tags"
}
}
}

Logical operators

Available for Catalog Data management

  • and: Search for STAC items whose parameter values satisfy both arguments.
  • or: Search for STAC items whose parameter values satisfy any of the arguments.
  • not: Exclude STAC items whose parameter values satisfy the argument.

An example with 'and': return items that have a GSD of 70 cm or less, and cloud coverage less than or equal to 20%

JSON
{
"filter": {
"op": "and",
"args": [
{
"op": "<=",
"args": [
{
"property": "gsd"
},
0.7
]
},
{
"op": "<=",
"args": [
{
"property": "eo:cloud_cover"
},
20.0
]
}
]
}
}

An example with 'or': return items that either have 'constellation': 'PNEO' or 'collection_name': 'pneo-tasking' in their parameters.

JSON
{
"filter": {
"op": "or",
"args": [
{
"op": "=",
"args": [
{
"property": "constellation"
},
"PNEO"
]
},
{
"op": "=",
"args": [
{
"property": "collection_name"
},
"pneo-tasking"
]
}
]
}
}

An example with 'not': return items that don't have 'constellation': 'PNEO' in their parameters

JSON
{
"filter": {
"op": "not",
"args": [
{
"op": "=",
"args": [
{
"property": "constellation"
},
"PNEO"
]
}
]
}
}

Spatial operators

Available for Data management

  • s_contains
  • s_crosses
  • s_disjoint
  • s_equals
  • s_intersects (also for Catalog )
  • s_overlaps
  • s_touches
  • s_within

A visual scheme of how s_overlaps and s_intersects work

A visual scheme of how s_contains, s_within, and s_intersects work

A visual scheme of how s_equals and s_intersects work

A visual scheme of how s_crosses and s_intersects work

A visual scheme of how s_disjoint works

A visual scheme of how s_touches works

An example with s_contains: return items whose geometries contain the defined polygon

JSON
{
"filter": {
"op": "s_contains",
"args": [
{
"property": "geometry"
},
{
"type": "Polygon",
"coordinates": [
[
[13.313668486610595, 52.55356060142003],
[13.313668486610595, 52.45865541990574],
[13.480777670201348, 52.45865541990574],
[13.480777670201348, 52.55356060142003],
[13.313668486610595, 52.55356060142003]
]
]
}
]
}
}

An example with s_crosses: return items whose geometries cross the defined line

JSON
{
"filter": {
"op": "s_crosses",
"args": [
{
"property": "geometry"
},
{
"type": "LineString",
"coordinates": [
[13.341955808701016, 52.51969146420771],
[13.366237996993789, 52.504786810390584]
]
}
]
}
}

An example with s_disjoint: return items that don't intersect with the defined polygon

JSON
{
"filter": {
"op": "s_disjoint",
"args": [
{
"property": "geometry"
},
{
"type": "Polygon",
"coordinates": [
[
[13.313668486610595, 52.55356060142003],
[13.313668486610595, 52.45865541990574],
[13.480777670201348, 52.45865541990574],
[13.480777670201348, 52.55356060142003],
[13.313668486610595, 52.55356060142003]
]
]
}
]
}
}

An example with s_equals: return items whose geometries exactly match the defined polygon

JSON
{
"filter": {
"op": "s_equals",
"args": [
{
"property": "geometry"
},
{
"type": "Polygon",
"coordinates": [
[
[13.370867464340053, 52.48392869357015],
[13.356655389450955, 52.49894514421745],
[13.356759290471304, 52.49912191483249],
[13.363463410709915, 52.505445701439136],
[13.40398287087849, 52.505257472987886],
[13.370867464340053, 52.48392869357015]
]
]
}
]
}
}

An example with s_within: return items whose geometries are within the defined polygon

JSON
{
"filter": {
"op": "s_within",
"args": [
{
"property": "geometry"
},
{
"type": "Polygon",
"coordinates": [
[
[-123.47593244349214, 48.65881246874093],
[-123.44562410769204, 48.65893370548264],
[-123.44429739341179, 48.658161559812235],
[-123.44376648785145, 48.65522725021609],
[-123.47599504628167, 48.655076990420135],
[-123.47602614621897, 48.65838026437638],
[-123.47601340902926, 48.658758157043785],
[-123.47593244349214, 48.65881246874093],
[-123.47593244349214, 48.65881246874093]
]
]
}
]
}
}

An example with s_intersects: return items whose geometries intersect with the defined polygon

JSON
{
"filter": {
"op": "s_intersects",
"args": [
{
"property": "geometry"
},
{
"type": "Polygon",
"coordinates": [
[
[13.370867464340053, 52.48392869357015],
[13.356655389450955, 52.49894514421745],
[13.356759290471304, 52.49912191483249],
[13.363463410709915, 52.505445701439136],
[13.40398287087849, 52.505257472987886],
[13.370867464340053, 52.48392869357015]
]
]
}
]
}
}

An example with s_overlaps: return items whose geometries overlap with the defined polygon

JSON
{
"filter": {
"op": "s_overlaps",
"args": [
{
"property": "geometry"
},
{
"type": "Polygon",
"coordinates": [
[
[13.370867464340053, 52.48392869357015],
[13.356655389450955, 52.49894514421745],
[13.356759290471304, 52.49912191483249],
[13.363463410709915, 52.505445701439136],
[13.40398287087849, 52.505257472987886],
[13.370867464340053, 52.48392869357015]
]
]
}
]
}
}

An example with s_touches: return items whose geometries touch the defined point

JSON
{
"filter": {
"op": "s_touches",
"args": [
{
"property": "geometry"
},
{
"type": "Point",
"coordinates": [-123.47593244349214, 48.65881246874093]
}
]
}
}

Temporal operators

Available for Data management

  • t_after
  • t_before
  • t_contains
  • t_during
  • t_equals
  • t_finishes
  • t_finishedby
  • t_meets
  • t_metby
  • t_overlaps
  • t_overlappedby
  • t_starts
  • t_startedby

A visual scheme comparing how different temporal operators work

Use date and time in the RFC 3339 format: YYYY-MM-DDThh:mm:ssZ

Depending on the operator, you must pass an argument as a timestamp object ({"timestamp": "2023-03-21T00:00:00.000Z"}) or as an interval:

JSON
{
"interval": ["2021-03-21T00:00:00.000Z", "2023-04-18T00:00:00.000Z"]
}

An example with t_after: return items acquired after March 21, 2023

JSON
{
"filter": {
"op": "t_after",
"args": [
{
"property": "datetime"
},
{
"timestamp": "2023-03-21T00:00:00.000Z"
}
]
}
}

An example with t_before: return items acquired before March 21, 2023

JSON
{
"filter": {
"op": "t_before",
"args": [
{
"property": "datetime"
},
{
"timestamp": "2023-03-21T00:00:00.000Z"
}
]
}
}

An example with t_equals: return items acquired on March 21, 2023

JSON
{
"filter": {
"op": "t_equals",
"args": [
{
"property": "datetime"
},
{
"timestamp": "2023-03-21T00:00:00.000Z"
}
]
}
}

An example with t_overlaps: return items acquired between March 21, 2023, and April 18, 2023

JSON
{
"filter": {
"op": "t_overlaps",
"args": [
{
"property": "datetime"
},
{
"interval": ["2023-03-21T00:00:00.000Z", "2023-04-18T00:00:00.000Z"]
}
]
}
}

Learn more