Skip to content

Co-located Stacking service specifications

Service Description

The Co-located Stacking (STACK) on-demand service computes the co-location of single-band rasters having different map projections and spatial resolutions on a common grid. It performs resampling and warping of the secondary assets and the stacking of each secondary with the reference. The upsampling or/and downsampling of spatially overlapping rasters is performed on a common area (intersection based on STAC asset geometry) and is based only on pixel coordinates. The co-located stacking processor is built with the GDAL VRT method. The service requires input geocoded rasters, which are a prerequisite for the stacking service. As an example, input single-band rasters can be taken from multi-sensor optical or SAR calibrated data, from results of other on-demand processing services, and from auxiliary datasets (e.g. a DEM or a Land Cover). The service does not perform image registration. The co-location result depends on the level of accuracy of geopositioning of source images. The service can also generate new rasters from the co-located image stack using band arithmetic (via symbolic expressions).

Workflow

The STACK service implements the workflow depicted below.

graph TB b[(EO Datasets, Auxiliary Data <br> or Results)] style b fill:#ffde86,stroke:#333,color:#282828,stroke-width:2px b --> a1[input n] b --> a2[input ...] b --> a3[input 2] b --> an[input 1] subgraph Input style Input fill:#e8e8e8,stroke:#818181,color:#282828 a1[/Asset n/] style a1 fill:#acc8ff,stroke:#333,color:#282828,stroke-width:2px a2[/Asset .../] style a2 fill:#acc8ff,stroke:#333,color:#282828,stroke-width:2px a3[/Asset 2/] style a3 fill:#acc8ff,stroke:#333,color:#282828,stroke-width:2px an[/Asset 1/] style an fill:#acc8ff,stroke:#333,color:#282828,stroke-width:2px ba2[/AOI as WKT/] style ba2 fill:#acc8ff,stroke:#333,color:#282828,stroke-width:2px ba1[/S-expression/s/] style ba1 fill:#acc8ff,stroke:#333,color:#282828,stroke-width:2px end subgraph Co-located Stacking an --> stack[Co-located<br>stacking] a3 --> stack[Co-located<br>stacking] a2 --> stack[Co-located<br>stacking] a1 --> stack[Co-located<br>stacking] ba2 -.-> stack[Co-located<br>stacking] stack --> csn(Co-located<br>asset 1) style csn fill:#cfdfff,stroke:#333,color:#282828 stack --> cs3(Co-located<br>asset 2) style cs3 fill:#cfdfff,stroke:#333,color:#282828 stack --> cs2(Co-located<br>asset ...) style cs2 fill:#cfdfff,stroke:#333,color:#282828 stack --> cs1(Co-located<br>asset n) style cs1 fill:#cfdfff,stroke:#333,color:#282828 csn -.-> stack1[Band<br>arithmetic] cs3 -.-> stack1[Band<br>arithmetic] cs2 -.-> stack1[Band<br>arithmetic] cs1 -.-> stack1[Band<br>arithmetic] ba1 -.-> stack1[Band<br>arithmetic] end subgraph Output style Output fill:#e8e8e8,stroke:#818181,color:#282828 csn(Co-located<br>asset n) --> on[/Co-located<br>asset n/] style on fill:#acc8ff,stroke:#87afff,color:#282828,stroke-width:2px cs3(Co-located<br>asset ...) --> o3[/Co-located<br>asset .../] style o3 fill:#acc8ff,stroke:#87afff,color:#282828,stroke-width:2px cs2(Co-located<br>asset 2) --> o2[/Co-located<br>asset 2/] style o2 fill:#acc8ff,stroke:#87afff,color:#282828,stroke-width:2px cs1(Co-located<br>asset 1) --> o1[/Co-located<br>asset 1/] style o1 fill:#acc8ff,stroke:#87afff,color:#282828,stroke-width:2px stack1 -.-> oo[/New asset/s from <br> band arithmetic/] style oo fill:#acc8ff,stroke:#87afff,color:#282828,stroke-width:2px end

Input

Input of the STACK service can be geocoded images from supported SAR or optical sensors (e.g. reflectance or Sigma Nought single-band assets from Calibrated Datasets derived systematically in the calibration processing from supported Optical or SAR sensors). Co-location stacking is also possible if the input set of images is built by mixing single band assets from SAR and Optical Calibrated Datasets. Also, input single band assets in STACK can originates from Results of some on-demand processing services and from Auxiliary Datasets.

Parameters

The STACK service requires a specified number of mandatory and optional parameters. All service parameters are listed in the below Table 1.

Parameter Description Required Default value
Single band asset(s) List of single band assets to be colocated from Datasets, Aux Datasets or Results of processors YES
Area of Interest Area of interest expressed in WKT NO
S-expression/s S-expression/s to generate additional asset/s from the ones in the stack (e.g. average) NO
Table 1 - Parameters of the STACK service.

How to define a symbolic expression

In STACK band arithmetic, a new asset is defined with the name of the new output asset and it's associated s-expression separated by a colon : .

output_asset_name:(s-expression)

Warning

S-expressions can be made by using only the assets specified in input and not with all the assets available in the source Dataset, Aux Dataset or Result.

Warning

The s-expressions inserted by the user must be given within brackets.

As an example to derive a new asset as the average between red bands from a pair of input single band assets (1.red and 2.red):

average:(/ (+ 1.red 2.red) 2)

This will add a new asset called average in the co-located stack with average values derived from 1.red and 2.red.

S-expressions in STACK supports arithmetic (* + / -) and logical (< <= == != >= > & |) operators plus some pre-defined functions.

More information about supported functions can be found in Table 2.

Function Description Syntax
asarray convert the input (list, tuples, etc.) to an array (asarray x)
interp returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x (interp x xp fp)
mean returns the mean value (scalar) from the given input array x (mean x)
norm_diff returns the normalized difference between A and B as per ((x - y) / (x + y)) (norm_diff x y)
where return elements chosen from x or y depending on condition (where (condition) x y)

Table 2 - Supported functions that can be used in s-expressions.

Examples of s-expressions which can be used to generate new bands from the STACK are listed in the below sections.

Compute sum

The following s-expression:

sum:(+ 1.red 2.red)

can be used to generate a band as the sum of 1.red and 2.red.

Compute difference

The following s-expression:

difference:(- 1.red 2.red)

can be used to generate a band as the difference of 1.red and 2.red.

Compute average

The following s-expression:

average:(/ (+ 1.red 2.red) 2)

can be used to generate a band as the average between the values of 1.red and 2.red.

Compute normalized difference

The following s-expression:

ndvi:(norm_diff 1.nir 1.red)

can be used to derive multiple spectral indexes defined as normalized difference (e.g. NDVI, NDWI, NDBI, etc.).

Interpolate or rescale

The following s-expression:

rescaled:(interp 1.red (asarray 0 10000) (asarray 0 1))

can be used to interpolate the rescaled TOA reflectance into its original [0,1] range. Here (asarray 0 10000) returns [0, 10000] and is used to specify input range to be used for the interpolation.

Binarization

The following s-expression:

opt_water_mask:(where (>= (norm_diff 1.green 1.nir) 0.3) 1 0)

can be used to derive a water mask from the binarization of a spectral index. Here (norm_diff 1.green 1.nir) is used to derive the NDWI index. The value 0.3 represents the threshold as TOA reflectance. Similar s-expressions can be made also for SAR such as:

sar_water_mask:(where (<= 1.s0_db_c_hh -23) 1 0)

in which 1.s0_db_c_hh is the asset and the value -23 represents the threshold as Sigma Nought in dB.

Output

The output of STACK is a multi-mission and multitemporal co-located stack with N single band assets in COG format. The output STAC item includes as many assets as provided in input plus the ones generated with s-expressions.

STACK Product specifications can be found in the table below.

Attribute Value / description
Long Name Co-located stack from Optical or SAR EO data
Short Name source_reference_number.source_asset (e.g. 1.nir)
Description Multiband co-located stack of N images from optical and radar sensors
Processing level L1 / L2 (according to input)
Data Type Float32
Band N single-band
Format COG
Projection According to input
Fill Value According to input

Service Provider

The service is developed by Terradue.


Back to Wildfire services