THREDDS catalogs collect, organize, and describe accessible datasets. They provide a hierarchical structure for organizing the datasets as well as an access method (URL), and a human-understandable name for each dataset. Further descriptive information about each dataset can also be added.
Here’s an example of a very simple catalog:
<?xml version="1.0" ?> <!-- 1 -->
<catalog xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0" > <!-- 2 -->
<service name="odap" serviceType="OpenDAP" base="/thredds/dodsC/" /> <!-- 3 -->
<dataset name="SAGE III Ozone 2006-10-31" serviceName="odap" urlPath="sage/20061031.nc" ID="20061031.nc"/> <!-- 4 -->
</catalog> <!-- 5 -->
with this line-by-line explanation:
- The first line indicates that this is an XML document.
- This is the
root
element of the XML, thecatalog
element. It must declare the THREDDS catalog namespace with thexmlns
attribute exactly as shown. - This declares a service named
odap
that will serve data via the OpenDAP protocol. Many other data access services come bundled with THREDDS. - This declares a dataset named
SAGE III Ozone 2006-10-31
. It references theodap
service, meaning it will be served via OpenDAP. The URL to access the dataset is discussed next. - This closes the
catalog
element.
Constructing An Access URL
Using the catalog directly above, here are the steps for client software to construct a dataset access URL:
-
Find the
service
referenced by the dataset:<service name="odap" serviceType="OpenDAP" base="/thredds/dodsC/" /> <dataset name="SAGE III Ozone 2006-10-31" serviceName="odap" urlPath="sage/20061031.nc" ID="20061031.nc"/>
- Append the
service base
path to the server root to construct the service base URL:- serverRoot =
http://hostname:port
- serviceBasePath =
/thredds/dodsC/
- serviceBaseUrl =
serverRoot + serviceBasePath =
http://hostname:port/thredds/dodsC/`
- serverRoot =
- Find the
urlPath
referenced by thedataset
:<dataset name="SAGE III Ozone 2006-10-31" serviceName="odap" urlPath="sage/20061031.nc" ID="20061031.nc"/>
- Append the
dataset
urlPath
to theservice base
URL to get the dataset access URL:- serviceBaseUrl =
http://hostname:port/thredds/dodsC/
- datasetUrlPath =
sage/20061031.nc
- datasetAccessUrl = serviceBaseUrl + datasetUrlPath =
http://hostname:port/thredds/dodsC/sage/20061031.nc
- serviceBaseUrl =
In summary, construct a URL from a client catalog with these 3 pieces:
http://hostname:port/thredds/dodsC/sage/20061031.nc
<------------------><------------><--------------->
server service dataset