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. Bear in mind the construction of a WCS request depends on the version supported by the data provider. Currently the versions are 1.0.0, 1.1.1 and 2.0.1.
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 orthogonal datasets with proper geographic information. Here is a list with WCS servers. For the Netherlands search the PDOK WCS services for Nertherlanda, for instance AHN25.
...
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.)
Example for 2.0.1 request on RWSProjectArchive geoserver.
HTML |
---|
https://rwsprojectarchief.openearth.nl/geoserver/mepduinen/wcs?service=WCS&version=2.0.1&request=GetCapabilities |
Inspect the overview of the 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 |
| Unlike |
These keywordd return data in the native resolution, some servers demand specification of a target grid:
keyword | value | source |
---|---|---|
crs | crs:84 | coordinate system |
resx | 0.1 | resolution |
resy | 0.1 | resolution |
Unlike WMS, to known which encoding formats are available, there is a separate request value DescribeCoverage
http://geoport.whoi.edu/thredds/wcs/bathy/srtm30plus_v6?service=WCS&request=DescribeCoverage&version=1.0.0
which is available when the request=GetCapabilities
contains
...
Code Block |
---|
... <supportedFormats> <formats>GeoTIFF</formats> <formats>GeoTIFF_Float</formats> <formats>NetCDF3</formats> </supportedFormats> ... |
For 2.0.1 request this is:
Code Block | ||
---|---|---|
| ||
https://rwsprojectarchief.openearth.nl/geoserver/mepduinen/wcs?service=WCS&version=2.0.1&request=DescribeCoverage&CoverageId=SpanjaardsDuinT0_50cm |
Important parameters for subsetting are described in the output. Check for srsName and axisLabels. These need to be used in the getCoverage request.
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.
...
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 |
For 2.0.1 the full GetCoverage request is presented below (incl. subsetting)
Code Block | ||
---|---|---|
|
...
| |
https://rwsprojectarchief.openearth.nl/geoserver/mepduinen/wcs?service=WCS
&version=2.0.1
&CoverageId=SpanjaardsDuinT0_50cm
&request=GetCoverage
&format=image/tiff
&subset=Y(446730.5,447414.5)
&subset=X(68628.5,68998.5) |
...
Gallery |
---|
Accessing WCS by Python OWSLib library
...