In this primer we will demonstrate how to obtain a small set of data from a large datasets with the OGC Web Coverage Service (WCS) protocol. We will show that ordering data through WCS is just as easy as buying an ice cream.
Find a WCS server
Find a data web source that hosts a WCS server (go to an ice cream vendor). We will use the Shuttle Radar Topography Mission datasets hosted at the Woods Hole Institute THREDDS OPeNDAP server as example in this primer. THREDDS OPeNDAP server can be configured to serve WCS for otrhogonal datasets with proper geographic information. Here is a list with WCS servers.
Request an overview of the content of a WCS server
Ask for what the server has to offer (see which flavours he has and which kind of cups). You need to add the following mandatory <keyword,value> pairs to the base server url, separated by an &, e.g.: ?service=WCS&request=GetCapabilities
.
keyword |
value |
source |
---|---|---|
service |
WCS |
Mandatory WCS standard value |
request |
GetCapabilities |
Mandatory WCS standard value |
This procedure works for all subsequent <keyword,value> pairs in this primer:
http://geoport.whoi.edu/thredds/wcs/bathy/srtm30plus_v6?service=WCS&request=GetCapabilities
This url will return an xml file that contains an inventory of the available datasets. (You can also request available datasets for one WCS version only by appending the optional version
keyword.)
Inspect the overview of the content of a WCS server
Look at what versions of WCS the server has to offer (check whether the ice cream is fresh). For each version there is a
tag WCS_Capabilities
with attribute version, e,.g.
<WCS_Capabilities version="1.0.0"> ... </WCS_Capabilities>
For each version a number of datasets is hosted. Select one dataset (ice cream flavour) from the list through the ContentMetadata
tag. The name of the dataset is the name
tag, in this case there is only topo
.
<ContentMetadata> <CoverageOfferingBrief> <description>topo meters true Topography</description> <name>topo</name> <label>Topography</label> ... </CoverageOfferingBrief> </ContentMetadata>
Request some content of a WCS server
Now we can actually get a subset from the dataset want by using request=GetCoverage
instead of the request=GetCapabilities
we used above to obtain the meta-data (order ice cream). The following <keyword,value> pairs are mandatory.
keyword |
value |
source |
|
---|---|---|---|
service |
WCS |
Mandatory WCS standard value |
|
request |
GetCoverage |
Mandatory WCS standard value |
|
version |
1.0.0 |
One of the mandatory WCS standard values returned by returned by the |
|
BBOX |
0,50,10,55 |
bounding box: min(longitude),min(latitude),max(longitude),max(latitude) |
|
coverage |
topo |
one of the |
|
format |
NetCDF3 |
The available formats (encoding types) are not returned by |
Unfortunately the WCS specification is too bit loose on the format encoding discovery, so we just have to guess which encoding formats are available (or try deciphering the incomprehensible official WCS standard documentation ...). There is a separate request value DescribeCoverage
that is apparently supposed to return this information. However,. apparently it is not supported by this server.
http://geoport.whoi.edu/thredds/wms/bathy/smith_sandwell_v11?service=WMS&version=1.3.0&request=DescribeCoverage&coverage=topo
Summary: correct WCS request for two available formats are given below. You can copy these into your browser to obtain the data. We chose the same bounding boxes as in the OPeNDAP primer that access these same datasets via netCDF libraries in Matlab, python or R. We discussed the pros and cons of WCS vs OPeNDAP in a FOSS4G paper.
http://geoport.whoi.edu/thredds/wcs/bathy/srtm30plus_v6?request=GetCoverage &version=1.0.0 &service=geotiff &coverage=topo &BBOX=0,50,10,55
http://geoport.whoi.edu/thredds/wcs/bathy/srtm30plus_v6?request=GetCoverage &version=1.0.0 &service=WCS &format=netcdf3 &coverage=topo &BBOX=0,50,10,55
for which the netCDF file look like
NetCDF-3 Classic srtm30plus_v6_netcdf3.nc { dimensions: lat = 601 ; lon = 1201 ; variables: int16 topo(lat,lon), shape = [601 1201] topo:_FillValue = -9999 s topo:grid_mapping = "GDAL_Geographics" topo:long_name = "Topography" topo:units = "meters" topo:coordinates = "lat lon lat lon" double lat(lat), shape = [601] lat:units = "degrees_north" lat:long_name = "Latitude" lat:_CoordinateAxisType = "Lat" lat:standard_name = "latitude" double lon(lon), shape = [1201] lon:units = "degrees_east" lon:long_name = "Longitude" lon:_CoordinateAxisType = "Lon" lon:standard_name = "longitude" //global Attributes: :Conventions = "CF-1.0" :AREA_OR_POINT = "Area" :title = "UCSD SRTM30_v6 Global DEM (30 sec)" :History = "Translated to CF-1.0 Conventions by Netcdf-Java CDM (NetcdfCFWriter) Original Dataset = bathy/srtm30plus_v6; Translation Date = Tue Nov 08 05:16:29 EST 2011" }
You can readily open and visualize this file with for instance ncBrowse.
Some additional, optional WCS keywords are:
keyword |
value |
source |
---|---|---|
time |
yyyy-mm-ddTHH:MM:SSZ |
ISO time notation. Not implemented in most GIS minded software packages, for an example implementation see the ADAGUC WMS server and WMS web client |
RESX |
numeric value |
interpolation resolution in x direction within |
RESY |
numeric value |
interpolation resolution in y direction within |
There are no images attached to this page. |