In this primer we will demonstrate how to obtain a graps of a small set of data from a large datasets with the OGC Web Mapping Service (WMS) protocol. We will show that ordering images through WMS is just as easy as buying an ice cream.
?service=WMS&request=GetCapabilities
.
keyword |
value |
source |
---|---|---|
service |
WMS |
Mandatory WMS standard value |
request |
GetCapabilities |
Mandatory WMS standard value |
http://geoport.whoi.edu/thredds/wms/bathy/srtm30plus_v6?service=WMS&request=GetCapabilities |
version
keyword.)WCS_Capabilities
with attribute version, e,.g.
<WMS_Capabilities version="1.3.0" ... > <Capability> <Request> ... <GetMap> <Format>image/jpeg</Format> <Format>image/png</Format> <Format>application/vnd.google-earth.kmz</Format> <Format>image/gif</Format> ... </GetMap> ... </WMS_Capabilities> |
Layer
tag. The name of the dataest is the name
tag, in this case there is only topo
.
<Layer> ... <CRS>EPSG:4326</CRS> <CRS>CRS:84</CRS> <CRS>EPSG:41001</CRS> <CRS>EPSG:3857</CRS> <CRS>EPSG:27700</CRS> <CRS>EPSG:3408</CRS> <CRS>EPSG:3409</CRS> <CRS>EPSG:32661</CRS> <CRS>EPSG:32761</CRS> ... <Layer> <Title>UCSD SRTM30_v6 Global DEM (30 sec)</Title> <Layer queryable="1"> <Name>topo</Name> ... <Style><Name>boxfill/redblue </Name>... <Style><Name>boxfill/redblue </Name>... <Style><Name>boxfill/alg </Name>... <Style><Name>boxfill/ncview </Name>... <Style><Name>boxfill/greyscale </Name>... <Style><Name>boxfill/alg2 </Name>... <Style><Name>boxfill/occam </Name>... <Style><Name>boxfill/rainbow </Name>... <Style><Name>boxfill/sst_36 </Name>... <Style><Name>boxfill/ferret </Name>... <Style><Name>boxfill/occam_pastel-30</Name> ... </Layer> </Layer> </Layer> |
request=GetMap
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 |
WMS |
Mandatory WMS standard value |
request |
GetMap |
Mandatory WMS standard value |
version |
1.3.0 |
One of the mandatory WMS standard values returned by returned by the |
BBOX |
0,50,10,55 |
min(longitude),min(latitude),max(longitude),max(latitude) |
layers |
topo |
WMS counterpart of WCS |
format |
image/png |
One of the mandatory WMS standard values by returned by the |
CRS |
EPSG%3A4326 |
One of the server-defined values by returned by the |
width |
800 |
width of the image in number of pixels. The xml file show a max |
height |
600 |
height of the image in number of pixels |
styles |
boxfill/redblue |
One of the server-defined values by returned by the |
Summary: correct WMS request for an available formats is given below. You can copy it into your browser to obtain the image. 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.
http://geoport.whoi.edu/thredds/wms/bathy/smith_sandwell_v11?service=WMS &version=1.3.0 &request=GetMap &bbox=0,50,10,55 &layers=topo &format=image/png &crs=EPSG%3A4326 &width=800 &height=600 &styles=boxfill/redblue |
Additional optional WMS keywords are:
keyword |
value |
source |
---|---|---|
TRANSPARENT |
True |
Valid for fotmat that handle transparance, e.g. png. |
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 |