Unidata THREDDS Web Map Service


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

Status

The THREDDS WMS server is beta, please report any problems you have.

Which files can be served through the WMS server?

  1. Data files must contain gridded data.
  2. The NetCDF-Java Common Data Model must be able to identify the coordinates system used. Check this by opening in the Grid Panel of the ToolsUI application. There should be one or more variables shown as a GeoGrid.

Configuration

WMS must be enabled in the threddsConfig.xml configuration file before it can be used. This is done by adding an allow element to the WMS element as follows:

<WMS>
<allow>true</allow>
...
</WMS>

Once WMS is enabled, datasets can be configured to have a WMS access method in the TDS catalog configuration files 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/wms/" />

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>

The dataset can be configured by datasetRoot or datasetScan as appropriate (see "Basic Configuration"). They are listed in the resulting THREDDS catalogs as are other datasets. WMS clients may not be able to directly use the THREDDS catalogs to find the WMS services but the catalogs are useful for users to browse and for separate search services (e.g., OGC catalog services).

You can specify your own color pallettes by placing them in a directory and specifying the directory name in the threddsConfig.xml file:

<WMS>
...
<paletteLocationDir>/data/mypalettes/<paletteLocationDir>
</WMS>

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.

You can specify your own OGC metadata file in the threddsConfig.xml file:

<WMS>
...
<ogcMetaXML>OGCMeta.xml</ogcMetaXML>
</WMS>

Use an absolute file path, or a path reletive to ${tomcat_home}/content/thredds/. Otherwise the default file WEB-INF/OGCMeta.xml. is used.

Add a new JVM option to Tomcat Startup

You should add the following definition to the JVM command line when starting:

-Djava.awt.headless=true

The standard way you do this is by modifying the JAVA_OPTS environmental variable in ${tomcat_home}/bin/startup.sh:

JAVA_OPTS="-Xmx1024m -Xms512m -server -Djava.awt.headless=true"
export JAVA_OPTS  

This should eliminate an obscure bug concerning X servers that can crash Tomcat.

Serving Remote Datasets

The TDS can also serve remote datasets with the WMS protocol if configured to do so. 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 (see above). For example, an OPeNDAP URL might be

http://las.pfeg.noaa.gov/cgi-bin/nph-dods/data/oceanwatch/nrt/gac/AG14day.nc 

This can be served remotely as a WMS dataset with this URL:

http://servername:8080/thredds/wms?dataset=http://las.pfeg.noaa.gov/cgi-bin/nph-dods/data/oceanwatch/nrt/gac/AG14day.nc

Capabilities/Limitations


THREDDS This document is maintained by Unidata and was last updated June 2009. Send comments to THREDDS support.