-
Notifications
You must be signed in to change notification settings - Fork 37
User Defined Band Math Extension
This document describes a backwards-compatible non-standard extension to OGC WMS 1.3.0 to support user-defined calculated indicies (the user_band_math
extension). This extension is planned to be implemented by both datacube-ows and GSKY.
The new non-standard SupportedExtension
element in the GetCapabilities response is used to communicate to clients:
- which layers support the
user_band_math
extension. - the available spectral bands for each layer which supports the extension.
The GetCapabilities method has been extended to report on support for this extension (and possibly other similar non-standard extensions in future).
A new element has been added to the Capability
section of the GetCapabilities response: SupportedExtension
.
SupportedExtension
extends the abstract _ExtendedCapabilities
tag defined by the WMS standard and is defined in the http://dea.ga.gov.au/namespaces/wms_extensions
namespace. There will be one SupportedExtension
tag for each layer supporting a non-standard extension.
For example:
<dea:SupportedExtension>
<dea:Extension version="1.0.0">user_band_math</dea:Extension>
<dea:Layer>my_extended_layer</dea:Layer>
<dea:ExtensionProperty name="available_bands">nir</dea:ExtensionProperty>
<dea:ExtensionProperty name="available_bands">red</dea:ExtensionProperty>
<dea:ExtensionProperty name="available_bands">green</dea:ExtensionProperty>
<dea:ExtensionProperty name="available_bands">blue</dea:ExtensionProperty>
</dea:SupportedExtension>
This GetCapabilities snippet advertises that:
- The layer named "my_extended_layer" supports version 1.0.0 of the
user_band_math
extension. - The available spectral bands for layer "my_extended_layer" are nir, red, green and blue.
A second layer supporting the extension will be advertised in a separate SupportedExtension
section, with it's own list of available bands.
GetMap requests against a layer which supports the user_band_math
extension may take two forms:
-
A fully standards-compliant WMS GetMap request will be processed as per the WMS standards, with the
styles
parameter determining the resulting visualisation in the normal manner. -
If the following HTTP Get parameters are present, the
styles
parameter is ignored and the visualisation is determined as described below:
a) code=formula
Use the given formula to calculate a display index. A formula can consist of:
- band names (as advertised in the GetCapabilities document, as described above)
- simple mathematical operators: +, -, *, /, as well as parentheses () for evaluation precedence.
- integer or floating point numeric constants.
E.g. the following results in an NDVI (normalised difference vegetation index) visualisation:
code=(nir-red)/(nir+red)
b) colorscheme=rampname
Use a Matplotlib named colormap to render the data. Matplotlib colormaps are listed here
c) colorscalerange=min,max
The colour ramp is applied to the index calculation using the defined scale range. The scale range consists of the minimum and maximum values that will be mapped to the ends of the colour ramp. All values less than the minimum will be rendered as the same colour as the minimum value. Similarly, all values greater than the maximum will be rendered as the same colour as the maximum value.