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.
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 |
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.