Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
3604 views
Kernel: Python [conda env:mypy2]


Web Coverage Service (WCS)

Requesting GeoTIFF data through NCI's THREDDS Data Server

In this notebook:

The following material uses Geoscience Australia's Landsat 8 Data Collection which is available under the Creative Commons License 4.0. For more information on the collection and licensing, please click here.



Web Coverage Service (WCS)

NCI's THREDDS Data Server supports OGC's Web Coverage Service (WCS) for gridded data collections. The WCS service allows users to request data or subsets of data in either NetCDF3, GeoTIFF, or GeoTIFF-float format.

Constructing GetCoverage Requests

To extract data through the Web Coverage Service, a GetCoverage URL request needs to be constructed.

The request takes the following form:

http://dapds00.nci.org.au/thredds/wcs/<thredds-path-to-data-file>?service=WCS&version=1.0.0&request=GetCoverage&coverage=value&format=value&bbox=value&time=value&crs=valuevalue

where red indicates required fields, blue are optional, and green are where inputs values relevant to the dataset and user request need to be defined.

GetCoverage parameters:

ParameterRequired/OptionalInput
serviceRequiredWCS
versionRequired1.0.0
requestRequiredGetCoverage
coverageRequired<variable>
formatRequiredGeoTIFF , GeoTIFF_Float , NetCDF3
bbox*Required/Optional<xmin,ymin,xmax,ymax>
time*Required/Optional<time_value>
srs, or crsOptional<srs_value> or <crs_value>

*For large files and/or files with a time dimension, these might be necessary. If bbox is not defined the entire spatial domain will be returned (if server limits allow) and if time is not specified, either the first or sometimes last timestep is returned.

Once providing the appropriate values for the dataset, a URL can now be generated that will return the requested coverage (in this example the output is returned in the GeoTIFF format):

(When selecting or inputing this URL into a web browser, a file download should commence.)

http://dapds00.nci.org.au/thredds/wcs/rs0/tiles/EPSG3577/LS8_OLI_TIRS_NBAR/LS8_OLI_TIRS_NBAR_3577_-10_-21_2013.nc?service=WCS&version=1.0.0&request=GetCoverage&coverage=band_2&format=GeoTIFF&time=2013-12-11T01:51:06.153Z



Where to find the valid input values?

The WCS link on NCI's THREDDS catalog page will retrieve a WCS GetCapabilities request. This provides a list of the valid WCS operations and parameters, which can be helpful in constructing GetCoverage requests. If the request= option in the URL is changed to DescribeCoverage, additional information can be found.

Start by selecting the desired file from NCI THREDDS Catalog page: http://dapds00.nci.org.au/thredds/catalog/rs0/tiles/EPSG3577/LS8_OLI_TIRS_NBAR/catalog.html?dataset=rs0/tiles/EPSG3577/LS8_OLI_TIRS_NBAR/LS8_OLI_TIRS_NBAR_3577_-10_-21_2013.nc

Then by selecting the WCS link:

This will display the GetCapabilities page:

GetCapabilities example:

http://dapds00.nci.org.au/thredds/wcs/rs0/tiles/EPSG3577/LS8_OLI_TIRS_NBAR/LS8_OLI_TIRS_NBAR_3577_-10_-21_2013.nc?service=WCS&version=1.0.0&request=GetCapabilities

DescribeCoverage example:

http://dapds00.nci.org.au/thredds/wcs/rs0/tiles/EPSG3577/LS8_OLI_TIRS_NBAR/LS8_OLI_TIRS_NBAR_3577_-10_-21_2013.nc?service=WCS&version=1.0.0&request=DescribeCoverage








For more information on OGC standards specifications (WMS, WCS) and ncWMS: <br > http://www.opengeospatial.org/standards/wms <br > http://www.opengeospatial.org/standards/wcs <br > http://www.resc.rdg.ac.uk/trac/ncWMS/ <br >




Extra: Let's verify the request using GDAL

import gdal import matplotlib.pyplot as plt %matplotlib inline

Open/extract data

ds = gdal.Open('./data/WCS346460317402991834.tif') band = ds.GetRasterBand(1).ReadAsArray()

Plot

fig = plt.figure(figsize=(10,10)) plt.imshow(band, cmap='gist_earth')
<matplotlib.image.AxesImage at 0x111bb7110>
Image in a Jupyter notebook