Example
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
namedodap
that will serve data via the OpenDAP protocol. Many other data access services come bundled with THREDDS. - This declares a
dataset
namedSAGE III Ozone 2006-10-31
. It references theodap
service
on line 3, meaning it will be served via OpenDAP. TheURLPath
ofsage/20061031.nc
will provided a needed compontent to build the access URL - This closes the
catalog
element.
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