Skip to content

Instantly share code, notes, and snippets.

@alexgleith
Created August 6, 2019 23:44
Show Gist options
  • Save alexgleith/8eab954331749d1749034a5bfbfc004e to your computer and use it in GitHub Desktop.
Save alexgleith/8eab954331749d1749034a5bfbfc004e to your computer and use it in GitHub Desktop.
WMS config for the Open Data Cube OWS app
import re
# Static config for the wms metadata.
# pylint: skip-file
response_cfg = {
"Access-Control-Allow-Origin": "*", # CORS header
}
service_cfg = {
## Which web service(s) should be supported by this instance
# Defaults: wms: True, wcs: False, wmts: False
# Notes:
# WMTS support is implemented as a thin proxy to WMS. Some corners of the spec are interpreted
# somewhat loosely. In particular exception documents are directly translated from the underlying
# WMS error and are unlikely to be fully compliant with the WMTS standard.
# "wcs": True,
"wms": True,
"wmts": True,
## Required config for WMS and/or WCS
# Service title - appears e.g. in Terria catalog
"title": "WMS server for Alex's datacube",
# Service URL. Should a fully qualified URL or a list of fully qualified URLs that the service can return
# in the GetCapabilities document based on the requesting url
"url": [ "http://localhost:8000" ],
# URL that humans can visit to learn more about the WMS or organization
# should be fully qualified
"human_url": "http://hello.world",
# Provide S3 data URL for data_links in GetFeatureinfo
"s3_url": "http://data.au",
# Provide S3 bucket name for data_links in GetFeatureinfo
"s3_bucket": "s3_bucket_name",
# Supported co-ordinate reference systems
"published_CRSs": {
"EPSG:3857": { # Web Mercator
"geographic": False,
"horizontal_coord": "x",
"vertical_coord": "y",
},
"EPSG:4326": { # WGS-84
"geographic": True,
"vertical_coord_first": True
},
"EPSG:3577": { # GDA-94, internal representation
"geographic": False,
"horizontal_coord": "x",
"vertical_coord": "y",
},
},
## Required config for WCS
# Must be a geographic CRS in the published_CRSs list. EPSG:4326 is recommended, but any geographic CRS should work.
"default_geographic_CRS": "EPSG:4326",
# Supported WCS formats
"wcs_formats": {
# Key is the format name, as used in DescribeCoverage XML
"GeoTIFF": {
# Renderer is the FQN of a Python function that takes:
# * A WCSRequest object
# * Some ODC data to be rendered.
"renderer": "datacube_wms.wcs_utils.get_tiff",
# The MIME type of the image, as used in the Http Response.
"mime": "image/geotiff",
# The file extension to add to the filename.
"extension": "tif",
# Whether or not the file format supports multiple time slices.
"multi-time": False
},
"netCDF": {
"renderer": "datacube_wms.wcs_utils.get_netcdf",
"mime": "application/x-netcdf",
"extension": "nc",
"multi-time": True,
}
},
# The native wcs format must be declared in wcs_formats above.
"native_wcs_format": "GeoTIFF",
## Optional config for instances supporting WMS
# Max tile height/width. If not specified, default to 256x256
"max_width": 512,
"max_height": 512,
# Optional config for all services (WMS and/or WCS) - may be set to blank/empty, no defaults
"abstract": """Imagery from across the world.""",
"keywords": [
"landsat",
"australia",
"time-series",
],
"contact_info": {
"person": "Alex Leith",
"organisation": "Geoscience Australia",
"position": "Legend",
"address": {
"type": "Earth"
},
"telephone": "000 000 000",
"email": "test@example.com",
},
"fees": "",
"access_constraints": "",
# If True this will not calculate spatial extents
# in update_ranges.py but will instead use a default
# extent covering much of Australia for all
# temporal extents
# False by default (calculate spatial extents)
"use_default_extent": True,
# If using GeoTIFFs as storage
# this will set the rasterio env
# GDAL Config for GTiff Georeferencing
# See https://www.gdal.org/frmt_gtiff.html#georeferencing
"geotiff_georeference_source": "INTERNAL",
# Attribution. This entire section is optional. If provided, it is taken as the
# default attribution for any layer that does not override it.
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
# Logo image - e.g. for the attributed organisation
# "logo": {
# # Image width in pixels (optional)
# "width": 370,
# # Image height in pixels (optional)
# "height": 73,
# # URL for the logo image. (required if logo specified)
# "url": "https://www.ga.gov.au/__data/assets/image/0011/61589/GA-DEA-Logo-Inline-370x73.png",
# # Image MIME type for the logo - should match type referenced in the logo url (required if logo specified.)
# "format": "image/png",
# }
},
# These define the AuthorityURLs. They represent the authorities that define the layer "Identifiers" below.
# The spec allows AuthorityURLs to be defined anywhere on the Layer heirarchy, but datacube_ows treats them
# as global entities.
"authorities": {
# The authorities dictionary maps names to authority urls.
"dea": "https://sandbox.test.frontiersi.io",
# "idrus": "https://www.identifiers-r-us.com",
}
}
layer_cfg = [
# Layer Config is a list of platform configs
{
# Name and title of the platform layer.
# Platform layers are not mappable. The name is for internal server use only.
"name": "LANDSAT_8",
"title": "Landsat 8",
"abstract": "Images from the Landsat 8 satellite",
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
# Logo image - e.g. for the attributed organisation
"logo": {
# Image width in pixels (optional)
"width": 370,
# Image height in pixels (optional)
"height": 73,
# URL for the logo image. (required if logo specified)
"url": "https://www.ga.gov.au/__data/assets/image/0011/61589/GA-DEA-Logo-Inline-370x73.png",
# Image MIME type for the logo - should match type referenced in the logo url (required if logo specified.)
"format": "image/png",
}
},
"products": [
{
# Included as a keyword for the layer
"label": "USGS",
# Included as a keyword for the layer
"type": "Surface Reflectance",
# Included as a keyword for the layer
"variant": "",
# The WMS name for the layer
"name": "ls8_usgs_sr_scene",
# The Datacube name for the associated data product
"product_name": "ls8_usgs_sr_scene",
"bands": {
"red": ["crimson"],
"green": [],
"blue": [ "azure" ],
"nir": [ "near_infrared" ],
"swir1": [ "shortwave_infrared_1", "near_shortwave_infrared" ],
"swir2": [ "shortwave_infrared_2", "far_shortwave_infrared" ],
"coastal_aerosol": [ "far_blue" ],
},
"pq_dataset": "ls8_usgs_sr_scene",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
"pq_band": "pixel_qa",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 500.0,
"max_datasets_wms": 6,
# max_datasets_wcs is the WCS equivalent of max_datasets_wms. The main requirement for setting this
# value is to avoid gateway timeouts on overly large WCS requests (and reduce server load).
"max_datasets_wcs": 16,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [150, 180, 200, 160],
#
"extent_mask_func": "datacube_wms.ogc_utils.mask_by_val",
"ignore_info_flags": [],
# Include an additional list of utc dates in the WMS Get Feature Info
# HACK: only used for GSKY non-solar day lookup
"feature_info_include_utc_dates": True,
# Set to true if the band product dataset extents include nodata regions.
"data_manual_merge": False,
# Set to true if the pq product dataset extents include nodata regions.
"pq_manual_merge": False,
# Bands to always fetch from the Datacube, even if it is not used by the active style.
# Useful for when a particular band is always needed for the extent_mask_func,
"always_fetch_bands": [ ],
# Apply corrections for solar angle, for "Level 1" products.
# (Defaults to false - should not be used for NBAR/NBAR-T or other Analysis Ready products
"apply_solar_corrections": False,
# If this value is set then WCS works exclusively with the configured
# date and advertises no time dimension in GetCapabilities.
# Intended mostly for WCS debugging.
"wcs_sole_time": "2017-01-01",
"native_wcs_crs": "EPSG:3577",
# The resolution (x,y) for WCS.
# This is the number of CRS units (e.g. degrees, metres) per pixel in the horizontal and vertical
# directions for the native resolution. E.g. for a EPSG:3577 (25.0,25.0) for Landsat-8 and (10.0,10.0 for Sentinel-2)
"native_wcs_resolution": [ 25.0, 25.0 ],
"feature_list_urls": [
{
"url": "http://domain.tld/path/to/page.html",
"format": "text/html"
},
{
"url": "http://another-domain.tld/path/to/image.png",
"format": "image/png"
}
],
"data_urls": [
{
"url": "http://abc.xyz/data-link.xml",
"format": "application/xml"
}
],
"styles": [
# Examples of styles which are linear combinations of the available spectral bands.
#
{
"name": "simple_rgb",
"title": "Simple RGB",
"abstract": "Simple true-colour image, using the red, green and blue bands",
"components": {
# The component keys MUST be "red", "green" and "blue" (and optionally "alpha")
"red": {
# Band aliases may be used here.
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 1.0
}
},
# The raw band value range to be compressed to an 8 bit range for the output image tiles.
# Band values outside this range are clipped to 0 or 255 as appropriate.
"scale_range": [0.0, 3000.0]
},
# {
# "name": "cloud_masked_rgb",
# "title": "Simple RGB with cloud masking",
# "abstract": "Simple true-colour image, using the red, green and blue bands, with cloud masking",
# "components": {
# "red": {
# "red": 1.0
# },
# "green": {
# "green": 1.0
# },
# "blue": {
# "blue": 1.0
# }
# },
# # PQ masking example
# # All pixels where any of the listed flags are true are masked out.
# "pq_masks": [
# {
# "flags": {
# "cloud": "no_cloud"
# },
# },
# ],
# "scale_range": [0.0, 3000.0]
# },
# {
# "name": "cloud_and_shadow_masked_rgb",
# "title": "Simple RGB with cloud and cloud shadow masking",
# "abstract": "Simple true-colour image, using the red, green and blue bands, with cloud and cloud shadow masking",
# "components": {
# "red": {
# "red": 1.0
# },
# "green": {
# "green": 1.0
# },
# "blue": {
# "blue": 1.0
# }
# },
# # PQ masking example
# "pq_masks": [
# {
# "flags": {
# "cloud": "no_cloud",
# "cloud_shadow": "no_cloud_shadow"
# },
# },
# ],
# "scale_range": [0.0, 3000.0]
# },
{
"name": "extended_rgb",
"title": "Extended RGB",
"abstract": "Extended true-colour image, incorporating the coastal aerosol band",
"components": {
"red": {
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 0.6,
"coastal_aerosol": 0.4
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "wideband",
"title": "Wideband false-colour",
"abstract": "False-colour image, incorporating all available spectral bands",
"components": {
"red": {
"swir2": 0.255,
"swir1": 0.45,
"nir": 0.255,
},
"green": {
"nir": 0.255,
"red": 0.45,
"green": 0.255,
},
"blue": {
"green": 0.255,
"blue": 0.45,
"coastal_aerosol": 0.255,
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "infra_red",
"title": "False colour multi-band infra-red",
"abstract": "Simple false-colour image, using the near and short-wave infra-red bands",
"components": {
"red": {
"swir1": 1.0
},
"green": {
"swir2": 1.0
},
"blue": {
"nir": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "coastal_aerosol",
"title": "Spectral band 1 - Coastal aerosol",
"abstract": "Coastal aerosol band, approximately 435nm to 450nm",
"components": {
"red": {
"coastal_aerosol": 1.0
},
"green": {
"coastal_aerosol": 1.0
},
"blue": {
"coastal_aerosol": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "blue",
"title": "Spectral band 2 - Blue",
"abstract": "Blue band, approximately 453nm to 511nm",
"components": {
"red": {
"blue": 1.0
},
"green": {
"blue": 1.0
},
"blue": {
"blue": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "green",
"title": "Spectral band 3 - Green",
"abstract": "Green band, approximately 534nm to 588nm",
"components": {
"red": {
"green": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"green": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "red",
"title": "Spectral band 4 - Red",
"abstract": "Red band, roughly 637nm to 672nm",
"components": {
"red": {
"red": 1.0
},
"green": {
"red": 1.0
},
"blue": {
"red": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "nir",
"title": "Spectral band 5 - Near infra-red",
"abstract": "Near infra-red band, roughly 853nm to 876nm",
"components": {
"red": {
"nir": 1.0
},
"green": {
"nir": 1.0
},
"blue": {
"nir": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "swir1",
"title": "Spectral band 6 - Short wave infra-red 1",
"abstract": "Short wave infra-red band 1, roughly 1575nm to 1647nm",
"components": {
"red": {
"swir1": 1.0
},
"green": {
"swir1": 1.0
},
"blue": {
"swir1": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "swir2",
"title": "Spectral band 7 - Short wave infra-red 2",
"abstract": "Short wave infra-red band 2, roughly 2117nm to 2285nm",
"components": {
"red": {
"swir2": 1.0
},
"green": {
"swir2": 1.0
},
"blue": {
"swir2": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
#
# Examples of non-linear colour-ramped styles.
{
"name": "ndvi",
"title": "NDVI",
"abstract": "Normalised Difference Vegetation Index - a derived index that correlates well with the existence of vegetation",
# The index function is continuous value from which the heat map is derived.
#
# Three formats are supported:
# 1. A function object or lambda
# e.g. "index_function": lambda data: (data["nir"] - data["red"]) / (data["nir"] + data["red"]),
# Note that lambdas CANNOT use band aliases - they MUST use the native band name
#
# 2. A string containing a fully qualified path to a python function
# e.g. "index_function": "datacube_wms.ogc_utils.not_a_real_function_name",
#
# 3. A dict containing the following elements:
# a) "function" (required): A string containing the fully qualified path to a python function
# b) "args" (optional): An array of additional positional arguments that will always be passed to the function.
# c) "kwargs" (optional): An array of additional keyword arguments that will always be passed to the function.
# d) "pass_product_cfg" (optional): Boolean (defaults to False). If true, the relevant ProductLayerConfig is passed
# to the function as a keyword argument named "product_cfg". This is useful if you are passing band aliases
# to the function in the args or kwargs. The product_cfg allows the index function to convert band aliases to
# to band names.
#
# The function is assumed to take one arguments, an xarray Dataset. (Plus any additional
# arguments required by the args and kwargs values in format 3, possibly including product_cfg.)
#
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "nir",
"band2": "red"
}
},
# Band aliases can be used here.
"needed_bands": ["red", "nir"],
# The color ramp. Values between specified entries have both their alphas and colours
# interpolated.
"color_ramp": [
# Any value less than the first entry will have colour and alpha of the first entry.
# (i.e. in this example all negative values will be fully transparent (alpha=0.0).)
{
"value": -0.0,
"color": "#8F3F20",
"alpha": 0.0
},
{
"value": 0.0,
"color": "#8F3F20",
"alpha": 1.0
},
{
# do not have to defined alpha value
# if no alpha is specified, alpha will default to 1.0
# or max opacity
"value": 0.1,
"color": "#A35F18"
},
{
"value": 0.2,
"color": "#B88512"
},
{
"value": 0.3,
"color": "#CEAC0E"
},
{
"value": 0.4,
"color": "#E5D609"
},
{
"value": 0.5,
"color": "#FFFF0C"
},
{
"value": 0.6,
"color": "#C3DE09"
},
{
"value": 0.7,
"color": "#88B808"
},
{
"value": 0.8,
"color": "#529400"
},
{
"value": 0.9,
"color": "#237100"
},
# Values greater than the last entry will use the colour and alpha of the last entry.
# (N.B. This will not happen for this example because it is normalised so that 1.0 is
# maximum possible value.)
{
"value": 1.0,
"color": "#114D04"
}
],
"legend": {
# Instead of using the generated color ramp legend for the style, a URL to a PNG file can
# be used instead.
"url": "http://example.com/custom_style_image.png"
}
},
{
"name": "ndwi",
"title": "NDWI",
"abstract": "Normalised Difference Water Index - a derived index that correlates well with the existence of water",
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "green",
"band2": "nir"
}
},
"needed_bands": ["green", "nir"],
"range": [0.0, 1.0],
},
{
"name": "ndbi",
"title": "NDBI",
"abstract": "Normalised Difference Buildup Index - a derived index that correlates with the existence of urbanisation",
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "swir2",
"band2": "nir"
}
},
"needed_bands": ["swir2", "nir"],
"range": [0.0, 1.0],
},
# Hybrid style - blends a linear mapping and an colour-ramped index style
# There is no scientific justification for these styles, I just think they look cool. :)
{
"name": "rgb_ndvi",
"title": "NDVI plus RGB",
"abstract": "Normalised Difference Vegetation Index (blended with RGB) - a derived index that correlates well with the existence of vegetation",
# Mixing ration between linear components and colour ramped index. 1.0 is fully linear components, 0.0 is fully colour ramp.
"component_ratio": 0.6,
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "nir",
"band2": "red"
}
},
"needed_bands": ["red", "nir"],
"range": [0.0, 1.0],
"components": {
"red": {
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "simple_rgb",
# Attribution. This entire section is optional. If not provided, the default attribution
# from the parent platform or the service config is used.
# If no attribution is defined at any level, no attribution will be published.
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
}
},
{
# Included as a keyword for the layer
"label": "Feature Layer",
# Included as a keyword for the layer
"type": "Water Observations from Space",
# Included as a keyword for the layer
"variant": "",
# The WMS name for the layer
"name": "ls_usgs_wofs",
# The Datacube name for the associated data product
"product_name": "ls_usgs_wofs",
# The Datacube name for the associated pixel-quality product (optional)
# The name of the associated Datacube pixel-quality product
"pq_dataset": "ls_usgs_wofs",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
"pq_band": "water",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 500.0,
"max_datasets_wms": 6,
# max_datasets_wcs is the WCS equivalent of max_datasets_wms. The main requirement for setting this
# value is to avoid gateway timeouts on overly large WCS requests (and reduce server load).
"max_datasets_wcs": 16,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [200, 180, 180, 160],
# Extent mask function
# Determines what portions of dataset is potentially meaningful data.
"extent_mask_func": "datacube_wms.ogc_utils.mask_by_bitflag",
# (Defaults to false)
"pq_manual_merge": False,
# Flags listed here are ignored in GetFeatureInfo requests.
# (defaults to empty list)
"ignore_flags_info": [
"nodata",
# "noncontiguous",
],
"styles": [
{
"name": "observations",
"title": "Observations",
"abstract": "Observations",
"value_map": {
"water": [
{
"title": "Invalid",
"abstract": "Slope or Cloud",
"flags": {
"or": {
"cloud_shadow": True,
"cloud": True,
"nodata": True
}
},
"color": "#707070"
},
{
# Possible Sea Glint, also mark as invalid
"title": "",
"abstract": "",
"flags": {
"dry": True,
"sea": True
},
"color": "#707070"
},
{
"title": "Dry",
"abstract": "Dry",
"flags": {
"dry": True,
"sea": False,
},
"color": "#D99694"
},
{
"title": "Wet",
"abstract": "Wet or Sea",
"flags": {
"or": {
"wet": True,
"sea": True
}
},
"color": "#4F81BD"
}
]
}
},
{
"name": "wet",
"title": "Wet Only",
"abstract": "Wet Only",
"value_map": {
"water": [
{
"title": "Invalid",
"abstract": "Slope or Cloud",
"flags": {
"or": {
"cloud_shadow": True,
"cloud": True,
"nodata": True,
}
},
"color": "#707070",
"mask": True
},
{
# Possible Sea Glint, also mark as invalid
"title": "",
"abstract": "",
"flags": {
"dry": True,
"sea": True
},
"color": "#707070",
"mask": True
},
{
"title": "Dry",
"abstract": "Dry",
"flags": {
"dry": True,
"sea": False,
},
"color": "#D99694",
"mask": True
},
{
"title": "Wet",
"abstract": "Wet or Sea",
"flags": {
"or": {
"wet": True,
"sea": True
}
},
"color": "#4F81BD"
}
]
}
}
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "observations",
},
{
# Included as a keyword for the layer
"label": "Feature Layer",
# Included as a keyword for the layer
"type": "Fractional Cover",
# Included as a keyword for the layer
"variant": "",
"abstract": """
Fractional Cover version 2.2.1, 25 metre, 100km tile, Australian Albers Equal Area projection (EPSG:3577). Data is only visible at higher resolutions; when zoomed-out the available area will be displayed as a shaded region.
Fractional cover provides information about the the proportions of green vegetation, non-green vegetation (including deciduous trees during autumn, dry grass, etc.), and bare areas for every 25m x 25m ground footprint. Fractional cover provides insight into how areas of dry vegetation and/or bare soil and green vegetation are changing over time. The fractional cover algorithm was developed by the Joint Remote Sensing Research Program, for more information please see data.auscover.org.au/xwiki/bin/view/Product+pages/Landsat+Fractional+Cover
Fractional Cover products use Water Observations from Space (WOfS) to mask out areas of water, cloud and other phenomena.
This product contains Fractional Cover dervied from the Landsat 5, 7 and 8 satellites
For service status information, see https://status.dea.ga.gov.au""",
# The WMS name for the layer
"name": "ls8_usgs_fc_scene",
# The Datacube name for the associated data product
# "multi_product": False,
"product_name": "ls8_usgs_fc_scene",
# The Datacube name for the associated pixel-quality product (optional)
# The name of the associated Datacube pixel-quality product
"pq_dataset": "ls_usgs_wofs",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
"pq_band": "water",
# Fuse function for pq data
"pq_fuse_func": "datacube_wms.wms_utils.wofls_fuser",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 10.0,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [ 150, 180, 200, 160],
# Time Zone. In hours added to UTC (maybe negative)
# Used for rounding off scene times to a date.
# 9 is good value for imagery of Australia.
"time_zone": 9,
# Extent mask function
# Determines what portions of dataset is potentially meaningful data.
"extent_mask_func": lambda data, band: (data[band] != data[band].attrs['nodata']),
# Flags listed here are ignored in GetFeatureInfo requests.
# (defaults to empty list)
"ignore_info_flags": [],
"legend": {
"url": "https://data.dea.ga.gov.au/fractional-cover/fc-percentile/annual/v2.1.0/fcp_legend.png",
},
"wcs_default_bands": ["BS", "PV", "NPV"],
"styles": [
{
"name": "simple_fc",
"title": "Fractional Cover",
"abstract": "Fractional cover representation, with green vegetation in green, dead vegetation in blue, and bare soil in red",
"components": {
"red": {
"BS": 1.0
},
"green": {
"PV": 1.0
},
"blue": {
"NPV": 1.0
}
},
"scale_range": [0.0, 100.0],
"pq_masks": [
{
"flags": {
'dry': True
},
},
{
"flags": {
"cloud_shadow": False,
"cloud": False,
"sea": False
}
},
]
}
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "simple_fc",
},
{
# Included as a keyword for the layer
"label": "Annual Median - Fiji",
# Included as a keyword for the layer
"type": "Fractional Cover",
# Included as a keyword for the layer
"variant": "",
"abstract": """""",
# The WMS name for the layer
"name": "ls_usgs_fcp_fiji",
# The Datacube name for the associated data product
"product_name": "ls_usgs_fcp_fiji",
# The Datacube name for the associated pixel-quality product (optional)
# The name of the associated Datacube pixel-quality product
# "pq_dataset": "s2b_ard_granule",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
# "pq_band": "pixel_quality",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 10.0,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [150, 180, 200, 160],
# Time Zone. In hours added to UTC (maybe negative)
# Used for rounding off scene times to a date.
# 9 is good value for imagery of Australia.
"time_zone": 12,
# Extent mask function
# Determines what portions of dataset is potentially meaningful data.
"extent_mask_func": lambda data, band: (data[band] != data[band].attrs['nodata']),
# Flags listed here are ignored in GetFeatureInfo requests.
# (defaults to empty list)
"ignore_info_flags": [],
# Define layer wide legend graphic if no style is passed
# to GetLegendGraphic
"wcs_default_bands": ["BS_PC_50", "NPV_PC_50", "PV_PC_50"],
# Styles.
#
# See band_mapper.py
#
# The various available spectral bands, and ways to combine them
# into a single rgb image.
# The examples here are ad hoc
#
"styles": [
# Examples of styles which are linear combinations of the available spectral bands.
#
{
"name": "fcp_average",
"title": "Average FC",
"abstract": "",
"components": {
"red": {
"BS_PC_50": 1.0
},
"green": {
"PV_PC_50": 1.0
},
"blue": {
"NPV_PC_50": 1.0
}
},
"scale_range": [0.0, 100.0]
}
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "fcp_average",
}, # Fiji FCP
{
# Included as a keyword for the layer
"label": "Annual Median - Fiji",
# Included as a keyword for the layer
"type": "Water Observations from Space",
# Included as a keyword for the layer
"variant": "",
"abstract": """""",
# The WMS name for the layer
"name": "ls_usgs_wofs_fiji",
# The Datacube name for the associated data product
"product_name": "ls_usgs_wofs_fiji",
# The Datacube name for the associated pixel-quality product (optional)
# The name of the associated Datacube pixel-quality product
# "pq_dataset": "s2b_ard_granule",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
# "pq_band": "pixel_quality",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 10.0,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [150, 180, 200, 160],
# Time Zone. In hours added to UTC (maybe negative)
# Used for rounding off scene times to a date.
# 9 is good value for imagery of Australia.
"time_zone": 12,
# Extent mask function
# Determines what portions of dataset is potentially meaningful data.
"extent_mask_func": lambda data, band: (data[band] != data[band].attrs['nodata']),
# Flags listed here are ignored in GetFeatureInfo requests.
# (defaults to empty list)
"ignore_info_flags": [],
# Define layer wide legend graphic if no style is passed
# to GetLegendGraphic
"wcs_default_bands": ["count_wet", "count_clear", "frequency"],
# Styles.
#
# See band_mapper.py
#
# The various available spectral bands, and ways to combine them
# into a single rgb image.
# The examples here are ad hoc
#
"styles": [
# Examples of styles which are linear combinations of the available spectral bands.
#
{
"name": "water_observations",
"title": "Wet Count",
"abstract": "WOfS summary showing the count of water observations",
"needed_bands": ["count_wet"],
"color_ramp": [
{
"value": 0,
"color": "#666666",
"alpha": 0
},
{
"value": 1,
"color": "#890000"
},
{
"value": 2,
"color": "#990000"
},
{
"value": 3,
"color": "#E38400"
},
{
"value": 4,
"color": "#E3DF00"
},
{
"value": 5,
"color": "#A6E300"
},
{
"value": 6,
"color": "#00E32D"
},
{
"value": 7,
"color": "#00E3C8"
},
{
"value": 8,
"color": "#0097E3"
},
{
"value": 9,
"color": "#005FE3"
},
{
"value": 10,
"color": "#000FE3"
},
{
"value": 10,
"color": "#000EA9"
},
{
"value": 10,
"color": "#5700E3",
"legend": {
"prefix": ">"
}
}
],
"legend": {
"radix_point": 0,
"scale_by": 1,
"major_ticks": 100
}
},
{
"name": "wofs_frequency",
"title": " Water Summary",
"abstract": "WOfS summary showing the frequency of Wetness",
"needed_bands": ["frequency"],
"color_ramp": [
{
"value": 0.0,
"color": "#000000",
"alpha": 0.0
},
{
"value": 0.02,
"color": "#000000",
"alpha": 0.0
},
{
"value": 0.05,
"color": "#8e0101",
"alpha": 0.25
},
{
"value": 0.1,
"color": "#cf2200",
"alpha": 0.75
},
{
"value": 0.2,
"color": "#e38400"
},
{
"value": 0.3,
"color": "#e3df00"
},
{
"value": 0.4,
"color": "#62e300"
},
{
"value": 0.5,
"color": "#00e32d"
},
{
"value": 0.6,
"color": "#00e3c8"
},
{
"value": 0.7,
"color": "#0097e3"
},
{
"value": 0.8,
"color": "#005fe3"
},
{
"value": 0.9,
"color": "#000fe3"
},
{
"value": 1.0,
"color": "#5700e3"
}
],
"legend": {
"units": "%",
"radix_point": 0,
"scale_by": 100.0,
"major_ticks": 0.1
}
},
{
"name": "clear_observations",
"title": "Clear Count",
"abstract": "WOfS summary showing the count of clear observations",
"needed_bands": ["count_clear"],
"color_ramp": [
{
"value": 0,
"color": "#FFFFFF",
"alpha": 0
},
{
# purely for legend display
# we should not get fractional
# values in this styles
"value": 0.2,
"color": "#B21800",
"alpha": 1
},
{
"value": 1,
"color": "#B21800"
},
{
"value": 2,
"color": "#ef8500"
},
{
"value": 3,
"color": "#ffb800"
},
{
"value": 4,
"color": "#ffd000"
},
{
"value": 5,
"color": "#fff300"
},
{
"value": 6,
"color": "#fff300"
},
{
"value": 7,
"color": "#c1ec00"
},
{
"value": 8,
"color": "#6ee100"
},
{
"value": 9,
"color": "#39a500"
},
{
"value": 20,
"color": "#026900",
"legend": {
"prefix": ">"
}
}
],
"legend": {
"radix_point": 0,
"scale_by": 1,
"major_ticks": 10,
"axes_position": [0.05, 0.5, 0.89, 0.15]
}
},
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "wofs_frequency",
}, # Fiji WOfS
]
},
{
# Name and title of the platform layer.
# Platform layers are not mappable. The name is for internal server use only.
"name": "LANDSAT_7",
"title": "Landsat 7",
"abstract": "Images from the Landsat 7 satellite",
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
# Logo image - e.g. for the attributed organisation
"logo": {
# Image width in pixels (optional)
"width": 370,
# Image height in pixels (optional)
"height": 73,
# URL for the logo image. (required if logo specified)
"url": "https://www.ga.gov.au/__data/assets/image/0011/61589/GA-DEA-Logo-Inline-370x73.png",
# Image MIME type for the logo - should match type referenced in the logo url (required if logo specified.)
"format": "image/png",
}
},
"products": [
{
# Included as a keyword for the layer
"label": "USGS",
# Included as a keyword for the layer
"type": "Surface Reflectance",
# Included as a keyword for the layer
"variant": "",
# The WMS name for the layer
"name": "ls7_usgs_sr_scene",
# The Datacube name for the associated data product
"product_name": "ls7_usgs_sr_scene",
"bands": {
"red": ["crimson"],
"green": [],
"blue": [ "azure" ],
"nir": [ "near_infrared" ],
"swir1": [ "shortwave_infrared_1", "near_shortwave_infrared" ],
"swir2": [ "shortwave_infrared_2", "far_shortwave_infrared" ]
},
"pq_dataset": "ls7_usgs_sr_scene",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
"pq_band": "pixel_qa",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 500.0,
"max_datasets_wms": 6,
# max_datasets_wcs is the WCS equivalent of max_datasets_wms. The main requirement for setting this
# value is to avoid gateway timeouts on overly large WCS requests (and reduce server load).
"max_datasets_wcs": 16,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [150, 180, 200, 160],
#
"extent_mask_func": "datacube_wms.ogc_utils.mask_by_val",
"ignore_info_flags": [],
# Include an additional list of utc dates in the WMS Get Feature Info
# HACK: only used for GSKY non-solar day lookup
"feature_info_include_utc_dates": True,
# Set to true if the band product dataset extents include nodata regions.
"data_manual_merge": False,
# Set to true if the pq product dataset extents include nodata regions.
"pq_manual_merge": False,
# Bands to always fetch from the Datacube, even if it is not used by the active style.
# Useful for when a particular band is always needed for the extent_mask_func,
"always_fetch_bands": [ ],
# Apply corrections for solar angle, for "Level 1" products.
# (Defaults to false - should not be used for NBAR/NBAR-T or other Analysis Ready products
"apply_solar_corrections": False,
# If this value is set then WCS works exclusively with the configured
# date and advertises no time dimension in GetCapabilities.
# Intended mostly for WCS debugging.
"wcs_sole_time": "2017-01-01",
"native_wcs_crs": "EPSG:3577",
# The resolution (x,y) for WCS.
# This is the number of CRS units (e.g. degrees, metres) per pixel in the horizontal and vertical
# directions for the native resolution. E.g. for a EPSG:3577 (25.0,25.0) for Landsat-8 and (10.0,10.0 for Sentinel-2)
"native_wcs_resolution": [ 25.0, 25.0 ],
"feature_list_urls": [
{
"url": "http://domain.tld/path/to/page.html",
"format": "text/html"
},
{
"url": "http://another-domain.tld/path/to/image.png",
"format": "image/png"
}
],
"data_urls": [
{
"url": "http://abc.xyz/data-link.xml",
"format": "application/xml"
}
],
"styles": [
# Examples of styles which are linear combinations of the available spectral bands.
#
{
"name": "simple_rgb",
"title": "Simple RGB",
"abstract": "Simple true-colour image, using the red, green and blue bands",
"components": {
# The component keys MUST be "red", "green" and "blue" (and optionally "alpha")
"red": {
# Band aliases may be used here.
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 1.0
}
},
# The raw band value range to be compressed to an 8 bit range for the output image tiles.
# Band values outside this range are clipped to 0 or 255 as appropriate.
"scale_range": [0.0, 3000.0]
},
# {
# "name": "cloud_masked_rgb",
# "title": "Simple RGB with cloud masking",
# "abstract": "Simple true-colour image, using the red, green and blue bands, with cloud masking",
# "components": {
# "red": {
# "red": 1.0
# },
# "green": {
# "green": 1.0
# },
# "blue": {
# "blue": 1.0
# }
# },
# # PQ masking example
# # All pixels where any of the listed flags are true are masked out.
# "pq_masks": [
# {
# "flags": {
# "cloud": "no_cloud"
# },
# },
# ],
# "scale_range": [0.0, 3000.0]
# },
# {
# "name": "cloud_and_shadow_masked_rgb",
# "title": "Simple RGB with cloud and cloud shadow masking",
# "abstract": "Simple true-colour image, using the red, green and blue bands, with cloud and cloud shadow masking",
# "components": {
# "red": {
# "red": 1.0
# },
# "green": {
# "green": 1.0
# },
# "blue": {
# "blue": 1.0
# }
# },
# # PQ masking example
# "pq_masks": [
# {
# "flags": {
# "cloud": "no_cloud",
# "cloud_shadow": "no_cloud_shadow"
# },
# },
# ],
# "scale_range": [0.0, 3000.0]
# },
{
"name": "wideband",
"title": "Wideband false-colour",
"abstract": "False-colour image, incorporating all available spectral bands",
"components": {
"red": {
"swir2": 0.255,
"swir1": 0.45,
"nir": 0.255,
},
"green": {
"nir": 0.255,
"red": 0.45,
"green": 0.255,
},
"blue": {
"green": 0.255,
"blue": 0.45
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "infra_red",
"title": "False colour multi-band infra-red",
"abstract": "Simple false-colour image, using the near and short-wave infra-red bands",
"components": {
"red": {
"swir1": 1.0
},
"green": {
"swir2": 1.0
},
"blue": {
"nir": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "blue",
"title": "Spectral band 2 - Blue",
"abstract": "Blue band, approximately 453nm to 511nm",
"components": {
"red": {
"blue": 1.0
},
"green": {
"blue": 1.0
},
"blue": {
"blue": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "green",
"title": "Spectral band 3 - Green",
"abstract": "Green band, approximately 534nm to 588nm",
"components": {
"red": {
"green": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"green": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "red",
"title": "Spectral band 4 - Red",
"abstract": "Red band, roughly 637nm to 672nm",
"components": {
"red": {
"red": 1.0
},
"green": {
"red": 1.0
},
"blue": {
"red": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "nir",
"title": "Spectral band 5 - Near infra-red",
"abstract": "Near infra-red band, roughly 853nm to 876nm",
"components": {
"red": {
"nir": 1.0
},
"green": {
"nir": 1.0
},
"blue": {
"nir": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "swir1",
"title": "Spectral band 6 - Short wave infra-red 1",
"abstract": "Short wave infra-red band 1, roughly 1575nm to 1647nm",
"components": {
"red": {
"swir1": 1.0
},
"green": {
"swir1": 1.0
},
"blue": {
"swir1": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "swir2",
"title": "Spectral band 7 - Short wave infra-red 2",
"abstract": "Short wave infra-red band 2, roughly 2117nm to 2285nm",
"components": {
"red": {
"swir2": 1.0
},
"green": {
"swir2": 1.0
},
"blue": {
"swir2": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
#
# Examples of non-linear colour-ramped styles.
{
"name": "ndvi",
"title": "NDVI",
"abstract": "Normalised Difference Vegetation Index - a derived index that correlates well with the existence of vegetation",
# The index function is continuous value from which the heat map is derived.
#
# Three formats are supported:
# 1. A function object or lambda
# e.g. "index_function": lambda data: (data["nir"] - data["red"]) / (data["nir"] + data["red"]),
# Note that lambdas CANNOT use band aliases - they MUST use the native band name
#
# 2. A string containing a fully qualified path to a python function
# e.g. "index_function": "datacube_wms.ogc_utils.not_a_real_function_name",
#
# 3. A dict containing the following elements:
# a) "function" (required): A string containing the fully qualified path to a python function
# b) "args" (optional): An array of additional positional arguments that will always be passed to the function.
# c) "kwargs" (optional): An array of additional keyword arguments that will always be passed to the function.
# d) "pass_product_cfg" (optional): Boolean (defaults to False). If true, the relevant ProductLayerConfig is passed
# to the function as a keyword argument named "product_cfg". This is useful if you are passing band aliases
# to the function in the args or kwargs. The product_cfg allows the index function to convert band aliases to
# to band names.
#
# The function is assumed to take one arguments, an xarray Dataset. (Plus any additional
# arguments required by the args and kwargs values in format 3, possibly including product_cfg.)
#
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "nir",
"band2": "red"
}
},
# Band aliases can be used here.
"needed_bands": ["red", "nir"],
# The color ramp. Values between specified entries have both their alphas and colours
# interpolated.
"color_ramp": [
# Any value less than the first entry will have colour and alpha of the first entry.
# (i.e. in this example all negative values will be fully transparent (alpha=0.0).)
{
"value": -0.0,
"color": "#8F3F20",
"alpha": 0.0
},
{
"value": 0.0,
"color": "#8F3F20",
"alpha": 1.0
},
{
# do not have to defined alpha value
# if no alpha is specified, alpha will default to 1.0
# or max opacity
"value": 0.1,
"color": "#A35F18"
},
{
"value": 0.2,
"color": "#B88512"
},
{
"value": 0.3,
"color": "#CEAC0E"
},
{
"value": 0.4,
"color": "#E5D609"
},
{
"value": 0.5,
"color": "#FFFF0C"
},
{
"value": 0.6,
"color": "#C3DE09"
},
{
"value": 0.7,
"color": "#88B808"
},
{
"value": 0.8,
"color": "#529400"
},
{
"value": 0.9,
"color": "#237100"
},
# Values greater than the last entry will use the colour and alpha of the last entry.
# (N.B. This will not happen for this example because it is normalised so that 1.0 is
# maximum possible value.)
{
"value": 1.0,
"color": "#114D04"
}
],
"legend": {
# Instead of using the generated color ramp legend for the style, a URL to a PNG file can
# be used instead.
"url": "http://example.com/custom_style_image.png"
}
},
{
"name": "ndwi",
"title": "NDWI",
"abstract": "Normalised Difference Water Index - a derived index that correlates well with the existence of water",
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "green",
"band2": "nir"
}
},
"needed_bands": ["green", "nir"],
"range": [0.0, 1.0],
},
{
"name": "ndbi",
"title": "NDBI",
"abstract": "Normalised Difference Buildup Index - a derived index that correlates with the existence of urbanisation",
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "swir2",
"band2": "nir"
}
},
"needed_bands": ["swir2", "nir"],
"range": [0.0, 1.0],
},
# Hybrid style - blends a linear mapping and an colour-ramped index style
# There is no scientific justification for these styles, I just think they look cool. :)
{
"name": "rgb_ndvi",
"title": "NDVI plus RGB",
"abstract": "Normalised Difference Vegetation Index (blended with RGB) - a derived index that correlates well with the existence of vegetation",
# Mixing ration between linear components and colour ramped index. 1.0 is fully linear components, 0.0 is fully colour ramp.
"component_ratio": 0.6,
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "nir",
"band2": "red"
}
},
"needed_bands": ["red", "nir"],
"range": [0.0, 1.0],
"components": {
"red": {
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "simple_rgb",
# Attribution. This entire section is optional. If not provided, the default attribution
# from the parent platform or the service config is used.
# If no attribution is defined at any level, no attribution will be published.
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
}
}
]
},
{
# Name and title of the platform layer.
# Platform layers are not mappable. The name is for internal server use only.
"name": "LANDSAT_5",
"title": "Landsat 5",
"abstract": "Images from the Landsat 5 satellite",
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
# Logo image - e.g. for the attributed organisation
"logo": {
# Image width in pixels (optional)
"width": 370,
# Image height in pixels (optional)
"height": 73,
# URL for the logo image. (required if logo specified)
"url": "https://www.ga.gov.au/__data/assets/image/0011/61589/GA-DEA-Logo-Inline-370x73.png",
# Image MIME type for the logo - should match type referenced in the logo url (required if logo specified.)
"format": "image/png",
}
},
"products": [
{
# Included as a keyword for the layer
"label": "USGS",
# Included as a keyword for the layer
"type": "Surface Reflectance",
# Included as a keyword for the layer
"variant": "",
# The WMS name for the layer
"name": "ls5_usgs_sr_scene",
# The Datacube name for the associated data product
"product_name": "ls5_usgs_sr_scene",
"bands": {
"red": ["crimson"],
"green": [],
"blue": [ "azure" ],
"nir": [ "near_infrared" ],
"swir1": [ "shortwave_infrared_1", "near_shortwave_infrared" ],
"swir2": [ "shortwave_infrared_2", "far_shortwave_infrared" ]
},
"pq_dataset": "ls5_usgs_sr_scene",
# The name of the measurement band for the pixel-quality product
# (Only required if pq_dataset is set)
"pq_band": "pixel_qa",
# Min zoom factor - sets the zoom level where the cutover from indicative polygons
# to actual imagery occurs.
"min_zoom_factor": 500.0,
"max_datasets_wms": 6,
# max_datasets_wcs is the WCS equivalent of max_datasets_wms. The main requirement for setting this
# value is to avoid gateway timeouts on overly large WCS requests (and reduce server load).
"max_datasets_wcs": 16,
# The fill-colour of the indicative polygons when zoomed out.
# Triplets (rgb) or quadruplets (rgba) of integers 0-255.
"zoomed_out_fill_colour": [150, 180, 200, 160],
#
"extent_mask_func": "datacube_wms.ogc_utils.mask_by_val",
"ignore_info_flags": [],
# Include an additional list of utc dates in the WMS Get Feature Info
# HACK: only used for GSKY non-solar day lookup
"feature_info_include_utc_dates": True,
# Set to true if the band product dataset extents include nodata regions.
"data_manual_merge": False,
# Set to true if the pq product dataset extents include nodata regions.
"pq_manual_merge": False,
# Bands to always fetch from the Datacube, even if it is not used by the active style.
# Useful for when a particular band is always needed for the extent_mask_func,
"always_fetch_bands": [ ],
# Apply corrections for solar angle, for "Level 1" products.
# (Defaults to false - should not be used for NBAR/NBAR-T or other Analysis Ready products
"apply_solar_corrections": False,
# If this value is set then WCS works exclusively with the configured
# date and advertises no time dimension in GetCapabilities.
# Intended mostly for WCS debugging.
"wcs_sole_time": "2017-01-01",
"native_wcs_crs": "EPSG:3577",
# The resolution (x,y) for WCS.
# This is the number of CRS units (e.g. degrees, metres) per pixel in the horizontal and vertical
# directions for the native resolution. E.g. for a EPSG:3577 (25.0,25.0) for Landsat-8 and (10.0,10.0 for Sentinel-2)
"native_wcs_resolution": [ 25.0, 25.0 ],
"feature_list_urls": [
{
"url": "http://domain.tld/path/to/page.html",
"format": "text/html"
},
{
"url": "http://another-domain.tld/path/to/image.png",
"format": "image/png"
}
],
"data_urls": [
{
"url": "http://abc.xyz/data-link.xml",
"format": "application/xml"
}
],
"styles": [
# Examples of styles which are linear combinations of the available spectral bands.
#
{
"name": "simple_rgb",
"title": "Simple RGB",
"abstract": "Simple true-colour image, using the red, green and blue bands",
"components": {
# The component keys MUST be "red", "green" and "blue" (and optionally "alpha")
"red": {
# Band aliases may be used here.
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 1.0
}
},
# The raw band value range to be compressed to an 8 bit range for the output image tiles.
# Band values outside this range are clipped to 0 or 255 as appropriate.
"scale_range": [0.0, 3000.0]
},
# {
# "name": "cloud_masked_rgb",
# "title": "Simple RGB with cloud masking",
# "abstract": "Simple true-colour image, using the red, green and blue bands, with cloud masking",
# "components": {
# "red": {
# "red": 1.0
# },
# "green": {
# "green": 1.0
# },
# "blue": {
# "blue": 1.0
# }
# },
# # PQ masking example
# # All pixels where any of the listed flags are true are masked out.
# "pq_masks": [
# {
# "flags": {
# "cloud": "no_cloud"
# },
# },
# ],
# "scale_range": [0.0, 3000.0]
# },
# {
# "name": "cloud_and_shadow_masked_rgb",
# "title": "Simple RGB with cloud and cloud shadow masking",
# "abstract": "Simple true-colour image, using the red, green and blue bands, with cloud and cloud shadow masking",
# "components": {
# "red": {
# "red": 1.0
# },
# "green": {
# "green": 1.0
# },
# "blue": {
# "blue": 1.0
# }
# },
# # PQ masking example
# "pq_masks": [
# {
# "flags": {
# "cloud": "no_cloud",
# "cloud_shadow": "no_cloud_shadow"
# },
# },
# ],
# "scale_range": [0.0, 3000.0]
# },
{
"name": "wideband",
"title": "Wideband false-colour",
"abstract": "False-colour image, incorporating all available spectral bands",
"components": {
"red": {
"swir2": 0.255,
"swir1": 0.45,
"nir": 0.255,
},
"green": {
"nir": 0.255,
"red": 0.45,
"green": 0.255,
},
"blue": {
"green": 0.255,
"blue": 0.45
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "infra_red",
"title": "False colour multi-band infra-red",
"abstract": "Simple false-colour image, using the near and short-wave infra-red bands",
"components": {
"red": {
"swir1": 1.0
},
"green": {
"swir2": 1.0
},
"blue": {
"nir": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "blue",
"title": "Spectral band 2 - Blue",
"abstract": "Blue band, approximately 453nm to 511nm",
"components": {
"red": {
"blue": 1.0
},
"green": {
"blue": 1.0
},
"blue": {
"blue": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "green",
"title": "Spectral band 3 - Green",
"abstract": "Green band, approximately 534nm to 588nm",
"components": {
"red": {
"green": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"green": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "red",
"title": "Spectral band 4 - Red",
"abstract": "Red band, roughly 637nm to 672nm",
"components": {
"red": {
"red": 1.0
},
"green": {
"red": 1.0
},
"blue": {
"red": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "nir",
"title": "Spectral band 5 - Near infra-red",
"abstract": "Near infra-red band, roughly 853nm to 876nm",
"components": {
"red": {
"nir": 1.0
},
"green": {
"nir": 1.0
},
"blue": {
"nir": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "swir1",
"title": "Spectral band 6 - Short wave infra-red 1",
"abstract": "Short wave infra-red band 1, roughly 1575nm to 1647nm",
"components": {
"red": {
"swir1": 1.0
},
"green": {
"swir1": 1.0
},
"blue": {
"swir1": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
{
"name": "swir2",
"title": "Spectral band 7 - Short wave infra-red 2",
"abstract": "Short wave infra-red band 2, roughly 2117nm to 2285nm",
"components": {
"red": {
"swir2": 1.0
},
"green": {
"swir2": 1.0
},
"blue": {
"swir2": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
#
# Examples of non-linear colour-ramped styles.
{
"name": "ndvi",
"title": "NDVI",
"abstract": "Normalised Difference Vegetation Index - a derived index that correlates well with the existence of vegetation",
# The index function is continuous value from which the heat map is derived.
#
# Three formats are supported:
# 1. A function object or lambda
# e.g. "index_function": lambda data: (data["nir"] - data["red"]) / (data["nir"] + data["red"]),
# Note that lambdas CANNOT use band aliases - they MUST use the native band name
#
# 2. A string containing a fully qualified path to a python function
# e.g. "index_function": "datacube_wms.ogc_utils.not_a_real_function_name",
#
# 3. A dict containing the following elements:
# a) "function" (required): A string containing the fully qualified path to a python function
# b) "args" (optional): An array of additional positional arguments that will always be passed to the function.
# c) "kwargs" (optional): An array of additional keyword arguments that will always be passed to the function.
# d) "pass_product_cfg" (optional): Boolean (defaults to False). If true, the relevant ProductLayerConfig is passed
# to the function as a keyword argument named "product_cfg". This is useful if you are passing band aliases
# to the function in the args or kwargs. The product_cfg allows the index function to convert band aliases to
# to band names.
#
# The function is assumed to take one arguments, an xarray Dataset. (Plus any additional
# arguments required by the args and kwargs values in format 3, possibly including product_cfg.)
#
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "nir",
"band2": "red"
}
},
# Band aliases can be used here.
"needed_bands": ["red", "nir"],
# The color ramp. Values between specified entries have both their alphas and colours
# interpolated.
"color_ramp": [
# Any value less than the first entry will have colour and alpha of the first entry.
# (i.e. in this example all negative values will be fully transparent (alpha=0.0).)
{
"value": -0.0,
"color": "#8F3F20",
"alpha": 0.0
},
{
"value": 0.0,
"color": "#8F3F20",
"alpha": 1.0
},
{
# do not have to defined alpha value
# if no alpha is specified, alpha will default to 1.0
# or max opacity
"value": 0.1,
"color": "#A35F18"
},
{
"value": 0.2,
"color": "#B88512"
},
{
"value": 0.3,
"color": "#CEAC0E"
},
{
"value": 0.4,
"color": "#E5D609"
},
{
"value": 0.5,
"color": "#FFFF0C"
},
{
"value": 0.6,
"color": "#C3DE09"
},
{
"value": 0.7,
"color": "#88B808"
},
{
"value": 0.8,
"color": "#529400"
},
{
"value": 0.9,
"color": "#237100"
},
# Values greater than the last entry will use the colour and alpha of the last entry.
# (N.B. This will not happen for this example because it is normalised so that 1.0 is
# maximum possible value.)
{
"value": 1.0,
"color": "#114D04"
}
],
"legend": {
# Instead of using the generated color ramp legend for the style, a URL to a PNG file can
# be used instead.
"url": "http://example.com/custom_style_image.png"
}
},
{
"name": "ndwi",
"title": "NDWI",
"abstract": "Normalised Difference Water Index - a derived index that correlates well with the existence of water",
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "green",
"band2": "nir"
}
},
"needed_bands": ["green", "nir"],
"range": [0.0, 1.0],
},
{
"name": "ndbi",
"title": "NDBI",
"abstract": "Normalised Difference Buildup Index - a derived index that correlates with the existence of urbanisation",
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "swir2",
"band2": "nir"
}
},
"needed_bands": ["swir2", "nir"],
"range": [0.0, 1.0],
},
# Hybrid style - blends a linear mapping and an colour-ramped index style
# There is no scientific justification for these styles, I just think they look cool. :)
{
"name": "rgb_ndvi",
"title": "NDVI plus RGB",
"abstract": "Normalised Difference Vegetation Index (blended with RGB) - a derived index that correlates well with the existence of vegetation",
# Mixing ration between linear components and colour ramped index. 1.0 is fully linear components, 0.0 is fully colour ramp.
"component_ratio": 0.6,
"index_function": {
"function": "datacube_wms.band_utils.norm_diff",
"pass_product_cfg": True,
"kwargs": {
"band1": "nir",
"band2": "red"
}
},
"needed_bands": ["red", "nir"],
"range": [0.0, 1.0],
"components": {
"red": {
"red": 1.0
},
"green": {
"green": 1.0
},
"blue": {
"blue": 1.0
}
},
"scale_range": [0.0, 3000.0]
},
],
# Default style (if request does not specify style)
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "simple_rgb",
# Attribution. This entire section is optional. If not provided, the default attribution
# from the parent platform or the service config is used.
# If no attribution is defined at any level, no attribution will be published.
"attribution": {
# Attribution must contain at least one of ("title", "url" and "logo")
# A human readable title for the attribution - e.g. the name of the attributed organisation
"title": "Digital Earth World",
# The associated - e.g. URL for the attributed organisation
"url": "https://sandbox.test.frontiersi.io",
}
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment