ERDDAP
> wms
> Documentation
ERDDAP's Web Map Service (WMS) lets you request an image with data plotted on a map.
WMS
is an
Open Geospatial Consortium (OGC)
and
ISO (19128)
standard for "the
creation and display of registered and superimposed map-like views of information that come
simultaneously from multiple remote and heterogeneous sources."
See the
list of datasets available via WMS at this ERDDAP installation.
Three Ways to Make Maps with WMS
- In theory, anyone can download, install, and use WMS client software.
Some clients are:
ArcGIS
and
uDig
.
To make these work, you would install the software on your computer.
Then, you would enter the URL of the WMS service into the client.
For example, in ArcGIS (not yet fully working because it doesn't handle time!), use
"Arc Catalog : Add Service : Arc Catalog Servers Folder : GIS Servers : Add WMS Server".
In ERDDAP, each dataset has its own WMS service, which is located at
http://merlin.dms.uconn.edu:8080/erddap/wms/datasetID/request?
For example: http://merlin.dms.uconn.edu:8080/erddap/wms/jplMURSST41/request?
(Some WMS client programs don't want the ? at the end of that URL.)
See the list of datasets available via WMS at this ERDDAP installation.
In practice, we haven't found any WMS clients that properly handle dimensions
other than longitude and latitude (e.g., time), a feature which is specified by the WMS
specification and which is utilized by most datasets in ERDDAP's WMS servers.
You may find that using a dataset's Make A Graph
form and selecting the .kml file type
(an OGC standard) to load images into Google Earth
provides a good (non-WMS) map client.
See the list of datasets with Make A Graph at this ERDDAP installation.
- Web page authors can embed a WMS client in a web page.
For example, ERDDAP uses
Leaflet
, which is a very versatile WMS client, for the WMS page for each ERDDAP dataset (like this).
See the list of datasets available via WMS at this ERDDAP installation.
Leaflet doesn't automatically deal with dimensions other than longitude and latitude
(e.g., time), so you will have to write JavaScript (or other scripting code) to do that.
(Adventurous JavaScript programmers can look at the Source Code from a web page like this.)
Another commonly used JavaScript WMS client is
OpenLayers
.
- A person with a browser or a computer program can generate special WMS URLs.
For example:
See the list of datasets available via WMS at this ERDDAP installation.
See the details below.
In practice, it is easier, more versatile,
and more efficient to use a dataset's Make A Graph web page
than to use WMS for this purpose.
See the list of datasets with Make A Graph at this ERDDAP installation.
A GetCapabilities request returns an XML document which provides background information
about the service and basic information about all of the data available from this
service. For this dataset, for WMS version 1.3.0, use
http://merlin.dms.uconn.edu:8080/erddap/wms/jplMURSST41/request?service=WMS&request=GetCapabilities&version=1.3.0
The supported parameters for a GetCapabilities request are:
name=value* |
Description |
service=WMS |
Required. |
version=version |
Currently, ERDDAP's WMS supports "1.1.0", "1.1.1", and "1.3.0".
This parameter is optional. The default is "1.3.0". |
request=GetCapabilities |
Required. |
* Parameter names are case-insensitive.
Parameter values are case sensitive and must be
percent encoded
:
all characters in query values other than A-Za-z0-9_-!.~'()* must be encoded as %HH, where
HH is the 2 digit hexadecimal value of the character, for example, space becomes %20.
Characters above #127 must be converted to UTF-8 bytes, then each UTF-8 byte must be percent encoded
(ask a programmer for help). There are
"
websites that percent encode/decode for you
.
The parameters may be in any order in the URL, separated by '&' .
A person with a browser or a computer program can generate a special URL to request a map.
The URL must be in the form
http://merlin.dms.uconn.edu:8080/erddap/wms/
datasetID/request?
query
The query for a WMS GetMap request consists of several
parameterName=value, separated by '&'.
For example,
http://merlin.dms.uconn.edu:8080/erddap/wms/jplMURSST41/request?service=WMS&version=1.3.0&request=GetMap&bbox=-89.99,-179.99,89.99,180.0&time=2002-06-01T09:00:00Z&crs=EPSG:4326&width=360&height=180&bgcolor=0x808080&layers=Land,jplMURSST41:analysed_sst,Coastlines,Nations&styles=&format=image/png
The
parameter options for the GetMap request are:
name=value* |
Description |
service=WMS |
Required. |
version=version |
Request version.
Currently, ERDDAP's WMS supports "1.1.0", "1.1.1", and "1.3.0". Required.
|
request=GetMap |
Request name. Required. |
layers=layer_list |
Comma-separated list of one or more map layers.
Layers are drawn in the order they occur in the list.
Currently in ERDDAP's WMS, the layer names from datasets are named datasetID
: variableName .
In ERDDAP's WMS, there are five layers not based on ERDDAP datasets:
- "Land" may be drawn BEFORE (as an under layer) or AFTER (as a land mask) layers from grid datasets.
- "Coastlines" usually should be drawn AFTER layers from grid datasets.
- "LakesAndRivers" draws lakes and rivers. This usually should be drawn AFTER layers from grid datasets.
- "Nations" draws national political boundaries. This usually should be drawn AFTER layers from grid datasets.
- "States" draws state political boundaries. This usually should be drawn AFTER layers from grid datasets.
Required.
|
styles=style_list |
Comma-separated list of one rendering style per requested layer.
Currently in ERDDAP's WMS, the only style offered for each layer is the default style,
which is specified via "" (nothing).
For example, if you request 3 layers, you can use "styles=,,".
Or, even easier, you can request the default style for all layers via "styles=".
Required.
|
1.1.0: srs=namespace:identifier
1.1.1: srs=namespace:identifier
1.3.0: crs=namespace:identifier |
Coordinate reference system.
Currently in ERDDAP's WMS 1.1.0, the only valid SRS is EPSG:4326.
Currently in ERDDAP's WMS 1.1.1, the only valid SRS is EPSG:4326.
Currently in ERDDAP's WMS 1.3.0, the only valid CRS's are CRS:84 and EPSG:4326,
Required.
|
bbox=4commaSeparatedValues |
Bounding box corners in SRS/CRS units.
For version=1.3.0 with CRS=EPSG:4326, the 4 values are: minLat,minLon,maxLat,maxLon.
For all other situations, the 4 values are: minLon,minLat,maxLon,maxLat.
(The reverse order! Yes, it's bizarre. Welcome to the world of OGC!)
ERDDAP supports requests within the dataset's longitude (perhaps 0 to 360, perhaps -180 to 180)
and latitude range. Most WMS clients assume longitude values are in the range -180 to 180.
If ERDDAP offers a variant of a dataset with longitude -180 to 180, use it for WMS requests.
Required.
|
width=output_width |
Width in pixels of map picture. Required.
|
height=output_height |
Height in pixels of map picture. Required.
|
format=output_format |
Output format of map. Currently in ERDDAP's WMS, only image/png is valid.
Required.
|
transparent=TRUE|FALSE |
Background transparency of map. Optional (default=FALSE).
If TRUE, any part of the image using the BGColor will be made transparent.
|
bgcolor=color_value |
Hexadecimal 0xRRGGBB color value for the background color. Optional (default=0xFFFFFF, white).
If transparent=true, we recommend bgcolor=0x808080 (gray), since white is in some color palettes.
|
exceptions=exception_format |
The format for WMS exception responses. Optional.
Currently, ERDDAP's WMS 1.1.0 and 1.1.1 supports
"application/vnd.ogc.se_xml" (the default),
"application/vnd.ogc.se_blank" (a blank image) and
"application/vnd.ogc.se_inimage" (the error in an image).
Currently, ERDDAP's WMS 1.3.0 supports "XML" (the default),
"BLANK" (a blank image), and
"INIMAGE" (the error in an image).
|
time=time |
Time value of layer desired, specified in ISO 8601 format: yyyy-MM-ddTHH:mm:ssZ .
Currently in ERDDAP's WMS, you can only specify one time value per request.
In ERDDAP's WMS, the value nearest to the value you specify (if between min and max) will be used.
In ERDDAP's WMS, the default value is the last value in the dataset's 1D time array.
In ERDDAP's WMS, "current" is interpreted as the last available time (recent or not).
Optional (in ERDDAP's WMS, the default is the last value, whether it is recent or not).
|
elevation=elevation |
Elevation of layer desired.
Currently in ERDDAP's WMS, you can only specify one elevation value per request.
In ERDDAP's WMS, this is used for the altitude or depth (converted to altitude) dimension (if any).
(in meters, positive=up)
In ERDDAP's WMS, the value nearest to the value you specify (if between min and max) will be used.
Optional (in ERDDAP's WMS, the default value is the last value in the dataset's 1D altitude or depth array).
|
dim_name=value |
Value of other dimensions as appropriate.
Currently in ERDDAP's WMS, you can only specify one value per dimension per request.
In ERDDAP's WMS, this is used for the non-time, non-altitude, non-depth dimensions.
The name of a dimension will be "dim_" plus the dataset's name for the dimension, for example "dim_model".
In ERDDAP's WMS, the value nearest to the value you specify (if between min and max) will be used.
Optional (in ERDDAP's WMS, the default value is the last value in the dimension's 1D array).
|
* Parameter names are case insensitive.
Parameter values are case sensitive and must be
percent encoded
:
all characters in query values other than A-Za-z0-9_-!.~'()* must be encoded as %HH, where
HH is the 2 digit hexadecimal value of the character, for example, space becomes %20.
Characters above #127 must be converted to UTF-8 bytes, then each UTF-8 byte must be percent encoded
(ask a programmer for help). There are
websites that percent encode/decode for you
.
The parameters may be in any order in the URL, separated by '&' .
(Revised from Table 8 of the WMS 1.3.0 specification)
- Dataset Requirements:
The main requirements for a variable to be accessible via
ERDDAP's WMS server are:
- The dataset must be an EDDGrid... dataset.
- The data variable MUST be a gridded variable.
- The data variable MUST have longitude and latitude axis variables. (Other axis variables
are OPTIONAL.)
- There MUST be some longitude values between -180 and 180.
- The
colorBarMinimum and colorBarMaximum attributes
MUST be specified. (Other color bar
attributes are OPTIONAL.)
- Grid data layers: In ERDDAP's WMS, all data variables in grid datasets that use
longitude and latitude dimensions are available via WMS.
Each such variable is available as a WMS layer, with the name datasetID
: variableName.
Each such layer is transparent (i.e., data values are represented as a range of colors
and missing values are represented by transparent pixels).
- Table data layers: Currently in ERDDAP's WMS, data variables in table datasets are
not available via WMS.
- Dimensions: A consequence of the WMS design is that the TIME, ELEVATION, and other
dimension values that you specify in a GetMap request apply to all of the layers.
There is no way to specify different values for different layers.
- Strict? The table above specifies how a client should form a GetMap request.
In practice, ERDDAP's WMS tries to be as lenient as possible when processing GetMap
requests, since many current clients don't follow the specification. However, if you
are forming GetMap URLs, we encourage you to try to follow the specification.
- Why are there separate WMS servers for each dataset? Because the GetCapabilities
document lists all values of all dimensions for each dataset, the information for each
dataset can be voluminous (easily 300 KB). If all of the gridded datasets (currently ~1000) at the
ERDDAP main site were to be included in one WMS, the resulting GetCapabilities document
would be huge (~300 MB) which would take a long time to download (causing many people
think something was wrong and give up) and would overwhelm most client software.
ERDDAP is compatible with the current WMS 1.3.0 standard.
ERDDAP is also compatible with the older
WMS 1.1.1 standard, which may be needed when working with older client software.
ERDDAP is also compatible with the older
WMS 1.1.0 standard, which may be needed when working with older client software.