"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 Coverage Service (WCS)

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 WCS Server

  • The THREDDS WCS Server implements the OGC Web Coverage Service 1.0.0 specification. It serves out gridded data in GeoTIFF or NetCDF format.

Enabling WCS

  • WCS is enabled in the threddsConfig.xml configuration file. This is done by adding an allow element to the WCS element as follows:
         <WCS>
            <allow>true</allow>
              ...
         </WCS>
         
    This allows WCS clients to specify a subset of a dataset and download GeoTIFF or netCDF files. By default, this service is off.
  • The WCS tag 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.

  • If WCS is allowed but the directory is not set, the TDS will use the ${tomcat_home}/content/thredds/wcs/wcache/ directory for temporary files.

Configuring THREDDS catalog for WCS.

  • Datasets are configured to have a WCS 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="wcs" serviceType="WCS" 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>wcs</serviceName></dataset>
         

Serving Remote Dataset

  • The TDS can also serve remote datasets with the WCS 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 WCS element as follows:
         <WCS>
            <allow>true</allow>
            <allowRemote>true</allowRemote>
              ...
         </WCS>
         
  • A slight extension of the WCS 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/wcs?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 WCS dataset with this URL:
          http://servername:8080/thredds/wcs?dataset=http://www.unidata.ucar.edu/projects/THREDDS/GALEON/TestDatasets/striped.nc
          

Examples of WCS queries

GetCoverage request

  • The GetCoverage request allows for the retrieval of coverages in a specified output format to the client
  • The following is a list of the required GetCoverage parameters according to the WCS spec:
    • VERSION=version: Request version
    • REQUEST=GetCoverage: Request name
    • COVERAGE=coverage_name: Name of an available coverage, as stated in the GetCapabilities
    • CRS=epsg_code: Coordinate Reference System in which the request is expressed.
    • BBOX=minx,miny,maxx,maxy: Bounding box corners (lower left, upper right) in CRS units. One of BBOX or TIME is required.
    • TIME=time1,time2: Request a subset corresponding to a time. One of BBOX or TIME is required..
    • WIDTH=output_width: Width in pixels of map picture. One of WIDTH/HEIGHT or RESX/Y is required.
    • HEIGHT=output_height: Height in pixels of map picture. One of WIDTH/HEIGHT or RESX/Y is required.
    • RESX=x: When requesting a georectified grid coverage, this requests a subset with a specific spatial resolution. One of WIDTH/HEIGHT or RESX/Y is required.
    • RESY=y: When requesting a georectified grid coverage, this requests a subset with a specific spatial resolution. One of WIDTH/HEIGHT or RESX/Y is required.
    • FORMAT=output_format: Output format of map, as stated in the GetCapabilities.
    • The following are optional GetCoverage parameters according to the WCS spec:
    • RESPONSE_CRS=epsg_code: Coordinate Reference System in which to express coverage responses.

Supported GetCoverage response formats

  • GeoTIFF: A grayscale 8-bit GeoTIFF file
  • GeoTIFFfloat: A floating point "Data Sample" GeoTIFF file
  • NetCDF3: A NetCDF file following the CF-1.0 convention

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: r2 - 15 Oct 2010, UnknownUser
 

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