"Seegrid will be due for a migration to confluence on the 1st of August. Any update on or after the 1st of August will NOT be migrated"

THREDDS Web Map Service (WMS)

Prerequiste:

  • Sun Java 1.6
  • Apache Tomcat 5.5 or above (Latest version of Tomcat 6.0 recommended)
  • THREDDS (Installation guide can be found here)

THREDDS WMS Server

  • The THREDDS WMS Server implements the OGC Web Map Service (WMS) 1.3.0 specification.

Data Pre-processing

The data to be hosted may be required to be pre processed first as certain file formats may not be supported by Thredds. Visit Thredds supprted file format page for more info. GDAL can be used for conversing between different file format.

QGIS can also be used for visualization of data or to retrieve metadata information such as retrieving the min/max range of the false color band.

qgis.png

Enabling WMS

  • WMS is enabled in the threddsConfig.xml configuration file. This is done by adding an allow element to the WCS element as follows:
         <WMS>
            <allow>true</allow>
              ...
         </WMS>
         

  • The WMStag accepts the following elements:
    • allow : to allow, change this to true. You must also add a WCS service in your catalogs, for the gridded datasets you want to server through WCS.
    • allowRemote : serve remote datasets with the WCS protocol.
    • dir : the working directory for files to be downloaded (choosing a cache directory)
    • scour : how often to scour the working directory, to delete files that were not successfully downloaded.
    • maxAge : how long to leave the files in the working directory while the download is occurring. The files are deleted after a successful download.
    • paletteLocationDir : Specify your own color pallettes by placing them in a directory and specifying the directory name #1
    • ogcMetaXML :Specify your own OGC metadata file. #2

  • #1 If the directory location starts with a "/", the path is absolute, otherwise it is relative to ${tomcat_home}/content/thredds/. If you dont specify it, or specify it incorrectly, the default pallettes will be used, which are in the war file under WEB-INF/pallettes.
  • #2 Use an absolute file path, or a path reletive to ${tomcat_home}/content/thredds/. Otherwise the default file WEB-INF/OGCMeta.xml. is used.

Configuring THREDDS catalog for WMS.

  • Datasets are configured to have a WMS access method in the TDS catalog configuration files (catalog.xml) similar to how other services are configured. The service element's serviceType and base attribute values must be as follows:
         <service name="wms" serviceType="WMS" base="/thredds/wcs/" />
         
  • The dataset to be served must reference this service (or a containing compound service) by the service name:
         <dataset ID="sample" name="Sample Data" urlPath="sample.nc">  <serviceName>wms</serviceName></dataset>
         

False Color

Thredds does not support false color by default but Ben has done some work to hack around this. More information can be found on

https://github.com/bencaradocdavies/tds42

Serving Remote Dataset

  • The TDS can also serve remote datasets with the WMS protocol if configured (see above). It must be explicitly configured in the threddsConfig.xml configuration file. This is done by adding an allowRemote element to the WMS element as follows:
         <WMS>
            <allow>true</allow>
            <allowRemote>true</allowRemote>
              ...
         </WMS>
         
  • A slight extension of the WMS Dataset URL format allows the TDS to serve remote datasets. The dataset is identified by adding the parameter dataset whose value is a URL:
         http://servername:8080/thredds/wms?dataset=datasetURL
         
  • The URL must be a dataset readable by the NetCDF-Java library, typically an OPeNDAP dataset on another server. It must have gridded data, with identifiable coordinate systems, etc. For example, an OPeNDAP URL might be:
             http://www.unidata.ucar.edu/projects/THREDDS/GALEON/TestDatasets/striped.nc
         
  • This can be served remotely as a WMS dataset with this URL:
          http://servername:8080/thredds/wms?dataset=http://www.unidata.ucar.edu/projects/THREDDS/GALEON/TestDatasets/striped.nc
          

Examples of WMS queries

  • GetCapabilities: Return an XML document with metadata containing Web Map Service Information
  • GetMap: Return an image as specified by a user.
  • GetLegendGraphic: This request will return the color scale information used to create the image.

Valid GetMap Request According to the WMS Specification

  • VERSION=version: Request version
  • REQUEST=GetMap: Request name
  • LAYERS=layer_list: Comma-separated list of one or more map layers.
  • SRS=namespace: Spatial Reference System.
  • BBOX=minx,miny,maxx,maxy: Bounding box corners (lower left, upper right) in SRS units.
  • WIDTH=output_width: Width in pixels of map picture.
  • HEIGHT=output_height: Height in pixels of map picture.
  • FORMAT=output_format: Output format of map.
  • TIME=layer_date: Date of the data requested (YYYY-MM-DD)

Valid GetLegendGraphic Request

  • SERVICE=WMS
  • VERSION=version: Request version
  • LAYER=Map Layer
  • FORMAT=output_format: Output format of map.

Debugging

  • The logs can be found at:
    • $CATALINA_HOME/logs
    • $CATALINA_HOME/content/thredds/logs

Related links:

Tested on:

  • apacsrv6

Acronyms

  • CDM - Common Data Model, similar to NetCDF but it has a richer set of low level data types and includes structures, sequences and grids.
  • DAS - Data Attribute Structure A description of the "metadata" attributes for an OPeNDAP dataset. See DODS.
  • DDS - Data Descriptor Structure A description of the data types and sizes of data in an OPeNDAP dataset. See DODS.
  • DODS - Distributed Oceanographic Data System The ancestor to OPeNDAP. See unidata.ucar.edu/packages/dods for information.
  • DTD - Document Type Definition This is the set of definitions that make up an XML specification.
  • OPeNDAP - Open Source Project for Network Data Access Protocol A network protocol for transmitting data across the internet. Though appropriate for many kinds of data, the system was designed with scientific data in mind.
  • THREDDS - Thematic Realtime Environmental Data Distributed Services A project of Unidata to create ways to establish useful collections of earth science data.
Topic revision: r4 - 23 Jun 2014, VictorTey
 

Current license: All material on this collaboration platform is licensed under a Creative Commons Attribution 3.0 Australia Licence (CC BY 3.0).