An XML configuration file exists for every OnEarth layer. This file is read by the OnEarth layer configuration tool, along with the associated support configuration files, to generate the WMTS and TWMS service document and OnEarth cache configuration file(s). The contents of the layer configuration file are listed below:
- Identifier - A unique identifier used as the WMTS Layer/Identifier and TWMS TiledGroup/Name values in the service GetCapabilities document. Ideally the identifier does not use any special characters as it is included in all WMTS and TWMS http requests.
- Title - A human readable title used as the WMTS Layer/Title and TWMS TiledGroup/Title values in the service GetCapabilities document.
- FileNamePrefix - An internal "short name" used as the prefix for MRF index, image, and metadata file names.
- HeaderFileName - A file path to an existing MRF metadata file for the layer. If the MRF metadata does not exist, use the "prefix" attribute to specify the filename to be used in the staging directories. When using "prefix", see below for the additional tags required to complete the layer configuration.
- Compression - The image file format. Valid values are "JPEG", "PNG", "EPNG" (encoded PNG), "TIF", "LERC", and "PBF" (vector tile protocol buffers). mod_onearth uses MIME types: "image/jpeg", "image/png", "image/tiff", "image/lerc", and "application/x-protobuf". Optional "style=encoded" in WMTS requests can be used for encoded PNGs.
- Projection - The identifier of the layer's associated projection as contained within the projection configuration and TileMatrixSets support files.
- TileMatrixSet - The identifier of the layer's associated TileMatrixSet within the projection as contained within the TileMatrixSets support file.
- EmptyTileSize or EmptyTile - The size, in bytes, of the layer's associated empty tile OR the location of the empty tile if is provided (the empty tile will be generated by oe_generate_empty_tile.py).
- The offset attribute is used to indicate an offset within the MRF's image file that points to the beginning of the empty tile. If the empty tile is at the beginning of the MRF image file, then the offset is '0'.
- Pattern(s) (Optional) - Pre-generated URL request patterns that are compiled into the OnEarth cache configuration file for optimized request matching.
- EnvironmentConfig - The file path to the layer's associated environment configuration support file.
- ArchiveLocation - The directory name within which MRF index, image, and metadata files will be placed.
- The static attribute indicates whether the layer varies by date (false) or is a single static image (true).
- The year attribute indicates whether files are grouped into subdirectories by year (true) or are all in the base directory (false).
- The root attribute references the unique identifier of the layer's associated archive location as contained in the archive configuration support file.
- ColorMap (Optional) - The file name for layer's associated colormap, if one exists, to be included in the WMTS GetCapabilities service document. The path is specified with
<ColorMapLocation>
in the environment configuration. A URL may also be used instead of a file name (deprecated). Multiple colormaps may be specified with the version designated by the attributeversion=
and the default designated bydefault={true/false}
. - StyleJSON (Optional) - The file name for layer's associated style JSON file (for vectors), if one exists, to be included in the WMTS GetCapabilities service document. The path is specified with
<StyleJSONLocation>
in the environment configuration. Multiple style JSON files may be specified with the version designated by the attributeversion=
and the default designated bydefault={true/false}
. - Time - The ISO 8601 time range for the layer. The tool may be configured to scan the file system to detect the the time (e.g.,
<Time>DETECT</Time>
). See Time Detection for details. - VectorType - Indicates the type of vector data if configuring a vector layer (i.e. Point, Polygon, etc.) that will be served via Mapserver. Must be a valid Shapefile data type.
- VectorStyleFile - Vector layers being served via Mapserver won't rasterize unless style data is applied to them. This tag specifies a file that contains the CLASS/STYLE information that should be included in the layer's Mapserver configuration.
Certain tags from MRF files can be also used in the layer config XML. In this case, they will override those tags that are present in the file specified by <HeaderFileName>
. It's not necessary to use an MRF header file if all the 'required' tags below are present in the layer config XML.
- Rsets (required if no MRF header) "scale" attribute indicates uniform scaling factor.
- BoundingBox (required if no MRF header) Bounding box for imagery.
- Size (required if no MRF header) Size of the image overview (at max resolution). The 'x' and 'y' sizes are indicated by attributes. A 'z' attribute of more than 1 requires a .zdb index file to be located in the MRF cache.
- PageSize (required if no MRF header) Denotes the tile dimensions for the MRF with 'x' and 'y' attributes.
- DataValues (optional) The 'NoData' attribute indicates the default no data value.
A different schema is used to configure reprojected layers. For more information, see the reprojection doc page.
A sample layer configuration file is shown here:
<?xml version="1.0" encoding="UTF-8"?>
<LayerConfiguration>
<Identifier>MODIS_Aqua_Cloud_Effective_Radius_v6</Identifier>
<Title>MODIS_Aqua_Cloud_Effective_Radius_v6</Title>
<FileNamePrefix>MYG06_L1D_CER</FileNamePrefix>
<HeaderFileName>/etc/onearth/config/headers/MYG06_L1D_CERTTTTTTT_.mrf</HeaderFileName>
<Compression>PNG</Compression>
<TileMatrixSet>2km</TileMatrixSet>
<EmptyTileSize offset="0">1397</EmptyTileSize>
<Projection>EPSG:4326</Projection>
<EnvironmentConfig>/etc/onearth/config/conf/environment_geographic.xml</EnvironmentConfig>
<ArchiveLocation static="false" year="true" root="geographic-aqua">MYG06_L1D_CER</ArchiveLocation>
<ColorMap>MODIS_Aqua_Cloud_Effective_Radius_v6.xml</ColorMap>
<Time>DETECT/DETECT/P1D</Time>
</LayerConfiguration>