OGC/ISO Services (WCS, WMS, and ncISO)

Setting up WCS, WMS, and ncISO

Configure TDS to Allow WCS, WMS, and ncISO Access

Out of the box, the TDS distribution will have WCS, WMS, and ncISO disabled. They must be explicitly allowed in the threddsConfig.xml file. The default threddsConfig.xml file (which should now be in your ${tomcat_home}/content/thredds directory) contains commented out sections for each of these services.

WCS Configuration

To enable the WCS service for locally served datasets, you will need the following in your threddsConfig.xml file:

<WCS>
  <allow>true</allow>
</WCS>

Additional WCS configuration options can be set in the threddsConfig.xml file, more details are available in the WCS section of the threddsConfig.xml file documentation.

WMS Configuration

To enable the WMS service for locally served datasets, you will need the following in your threddsConfig.xml file:

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

Additional WMS configuration options can be set in the threddsConfig.xml file, more details are available in the WMS section of the threddsConfig.xml file documentation.

ncISO Configuration

To enable the ncISO services for locally served datasets, you will need the following in your threddsConfig.xml file:

<NCISO>
  <ncmlAllow>true</ncmlAllow>
  <uddcAllow>true</uddcAllow>
  <isoAllow>true</isoAllow>
</NCISO>

Each "*Allow" element allows one of the three ncISO services.

Adding WCS and WMS Services

Once the WCS and WMS services are enabled, all that is required for the TDS to provide WCS and WMS access to datasets is for those datasets to reference WCS and WMS service elements. Adding them to an existing compound service would look something like this:

<service name="grid" serviceType="Compound" base="" >
    <service name="odap" serviceType="OpenDAP" base="/thredds/dodsC/" />
    <service name="wcs" serviceType="WCS" base="/thredds/wcs/" />
    <service name="wms" serviceType="WMS" base="/thredds/wms/" />
    <service name="ncss" serviceType="NetcdfSubset" base="/thredds/ncss/" />
    <service name="http" serviceType="HTTPServer" base="/thredds/fileServer/" />
</service>

Adding ncISO Services

Similar to above, once the ncISO services are enabled, all that is required for the TDS to provide ncISO services on datasets is for those datasets to reference the ncISO service elements. For instance, adding to the same compound service as above:

<service name="grid" serviceType="Compound" base="" >
    <service name="odap" serviceType="OpenDAP" base="/thredds/dodsC/" />
    <service name="wcs" serviceType="WCS" base="/thredds/wcs/" />
    <service name="wms" serviceType="WMS" base="/thredds/wms/" />
    <service name="ncss" serviceType="NetcdfSubset" base="/thredds/ncss/" />
    <service name="http" serviceType="HTTPServer" base="/thredds/fileServer/" />
    <service name="ncml" serviceType="NCML" base="/thredds/ncml/" />
    <service name="uddc" serviceType="UDDC" base="/thredds/uddc/" />
    <service name="iso" serviceType="ISO" base="/thredds/iso/" />
</service>

Exercise: Setup WCS and WMS Access for NAM Data

  1. Edit the TDS configuration file and allow WCS and WMS services as discussed above
    $ cd ${tomcat_home}/content/thredds
    $ vi threddsConfig.xml
    
    and add/replace the WCS and WMS elements (as described above)
    <WCS>
      <allow>true </allow>
    </WCS>
    <WMS>
      <allow>true </allow>
    </WMS>
    
  2. Edit the catalog.xml file and add WCS and WMS services to the NAM dataset
    <service name="wcs" serviceType="WCS" base="/thredds/wcs/" />
    <service name="wms" serviceType="WMS" base="/thredds/wms/" />
    
  3. Restart Tomcat so the TDS is reinitialized:
    $ cd ${tomcat_home}/bin
    $ ./shutdown.sh
    $ ./startup.sh
    
  4. Test that WCS and WMS are working:
    1. Bring the catalog up in a browser: http://localhost:8080/thredds/catalog.html
    2. Click down to one of the NAM dataset pages.
    3. Select the WCS Access link
    4. Go back, select the WMS Access link
  5. Check Dataset Viewer Links for Godiva2 (ToolsUI and Godiva2 are there but IDV is not).

Adding "Grid" DataType to Datasets

Once datasets are accessible over the WMS and WCS services, a quick look at the dataset pages shows several "Viewer" links available for each dataset (ToolsUI and Godiva2). The IDV "Viewer" link is only added for datasets with a "Grid" data type. This is not whether the dataset is recognized by the CDM as gridded but rather if the metadata in the catalog indicates that the dataset is a "Grid". This is accomplished with the dataType metadata element:

<dataType>Grid</dataType>

Exercise: Add "Grid" DataType to the NAM Data

  1. Edit the catalog.xml file and add a Grid dataType element (as above) to the NAM dataset.
  2. Restart Tomcat so the TDS is reinitialized:
    $ cd ${tomcat_home}/bin
    $ ./shutdown.sh
    $ ./startup.sh
    
  3. Check the dataset pages for the IDV Viewer link.

More WMS Configuration

Besides the basic WMS configuration available in the threddsConfig.xml file, there are additional configuration settings in the wmsConfig.xml file. These settings can be applied globally, by dataset, or by variable in a dataset, or to variables in any dataset by CF standard name.

Default Image Styling

There are additional configuration settings for default image styling including settings for the default values of color scale range, palette name, and number of color bands as well as whether to use a linear or logarithmic scale.

Detailed information is available from the WMS Detailed Configuration web page.

Interval Time vs Full Time List in GetCapabilities Documents

By default, the WMS will list all time values in a GetCapabilities document. For long time-series, this list can cause the GetCapabilities document to be quite large. Datasets/variables can be configured to use time intervals with the addition of an intervalTime element in the wmsConfig.xml file. For instance:

<intervalTime>true</intervalTime>
     

Unfortunately, though time intervals are part of the WMS specification, not all WMS clients know how to interpret time intervals in the GetCapabilities document.

Exercise: Try Modifying the wmsConfig.xml File

  1. Open a dataset in Godiva2 and plot a parameter.
  2. Notice the default color scale range is [-50,50]. Decide on a better color scale range.
  3. Open the " WMS Detailed Configuration" page in your browser.
  4. Edit the wmsConfig.xml file
    $ cd ${tomcat_home}/content/thredds
    $ vi wmsConfig.xml
    
    and change the color scale range for the target parameter in the chosen dataset.
  5. Reopen Godiva2 on the dataset and plot the target parameter. Check the new default color scale range.

Styling features and non-standard requests

ncWMS provides several styling and displaying capabilities that are also available in TDS:

Exercise: WMS request with styling parameters

  1. Open the non-standard optional parameters supported by ncWMS page
  2. Make several WMS request changing the color scale range and the displaying properties for the values out of range.
  3. Use this as base request.

Using WCS and WMS

Various WCS and WMS Clients

Godiva2 WMS Client

The Godiva2 WMS client is part of the ncWMS code base and as such is included in the TDS distribution. It is a web application written in JavaScript using the OpenLayers library.

In the TDS, you can access the Godiva2 client from the "Viewers" section of all WMS accessible datasets. The Godiva2 User Guide is available from the ncWMS site.

Godiva2

OWSLib (python client) example:

tds-python-workshop WMS notebook