Web Map Service

The OpenGIS® Web Map Service Interface Standard (WMS) The Web Feature Service (WFS) represents a change in the way geographic information is created, modified and exchanged on the Internet. Rather than sharing geographic information at the file level using File Transfer Protocol (FTP), for example, the WFS offers direct fine-grained access to geographic information at the feature and feature property level. Web feature services allow clients to only retrieve or modify the data they are seeking, rather than retrieving a file that contains the data they are seeking and possibly much more. That data can then be used for a wide variety of purposes, including purposes other than their producers’ intended ones (OGC, 2013). The OGC WMS 1.3.0 corresponds to the ISO 19128 standard. The WMS standard specifies a number of different request types (also called operations), two of which are required or obligatory for a compliant WMS server, GetCapabilities and GetMap.

Overview of WMS Operations

OperationDescription
GetCapabilities Returns metadata about available layers in the WMS server, including how to generate WMS requests and what values can be used in the required parameteres. The metadata for each layer includes: bounding box, coordinate reference system, URI of the data and whether the layer is mostly opaque or not.
DescribeLayer Returns specific information about the requested layer.
GetMap Returns a map image based on the set of provided parameters which include: width and height of the image, coordinate reference system, rendering style and image format.
GetFeatureInfo Returns attibute information associated to a given coordinate of the map image if the requested layer is ‘queryable’.
GetLegendGraphic Returns a legend, as an image, for the requated layer, providing a visual guide to elements represented in the map image.

GetCapabilities Request

Returns metadata about available layers in the WMS server, including how to generate WMS requests and what values can be used in the required parameters. The metadata for each layer includes: bounding box, coordinate reference system, URI of the data and whether the layer is mostly opaque or not. 1 shows the parameters of this operation.

Parameters of the WMS GetCapabilities request

ParameterValue Description
SERVICE In this case the value is WMS telling the server which service request is coming.
VERSION Specifies what version of the WMS service specification is being requested, 1.0.01.1.01.1.11.3.0.
REQUEST Tells the WMS server which operation is being requested. In this case, GetCapabilities.

In fact, all operations of the WMS standard require these three parameters when making a request. The example belows show how a WMS GetCapabilities request looks like:

https://gip.itc.utwente.nl/services/world_admin?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilitiesMessage

1 shows the resulting service response, which contains all required metadata values specify by the WMS standard. These values can then be used to construct further request and access the associated datasets. Some of the relevant lines have been highlighted, for example the provided coordinate systems and some of the names of available datasets.

Take the request URL used above and use it in one of your browser's tabs. Navigate the XML response document to familiarize yourself with the information it contains. This content will be used in the GetMap examples that follow.

Sometimes the response also contains the values of the bounding box in all the provided coordinate systems. See the example request below and the matching response in 2, which corresponds one of the services of the Dutch Central Bureau of Statistics (CBS).

https://service.pdok.nl/cbs/wijkenbuurten/2022/wms/v1_0?request=GetCapabilities&service=WMS

2 shows some parts of the answer to this request. Check the highlighted lines.

GetMap Request

A WMS server responding to a GetMap request returns a map image for a specified area and content. The resulting map image is created by the server using the set of parameter values provided by the service user in the request. 2 show the parameters required by a WMS GetMap operation request.

Parameters of the WMS GetMap request

ParameterValue Description
SERVICE In this case the value is WMS telling the server which service request is coming.
VERSION Specifies what version of the WMS service specification is being requested, 1.0.01.1.01.1.11.3.0.
REQUEST Tells the WMS server which operation is being requested. In this case, GetMap.
LAYERS Data sources to be used in the create the image of the response. The value is a comma-separated list of layer names.
CRS The identifier of spatial reference system for the map output. This value is provided in the form EPSG:4326. In versions prior to 1.3.0 this parameter is called SRS.
BBOX Bounding box for map extent. This value is the coordinates of the area of interest using units according to the CRS given in the previous parameter. For projected coordinate systems the value corresponds to minx,miny,maxx,maxy, otherwise it is minlat,minlong,maxlat,maxlong
WIDTH Width of map the image, in pixels.
HEIGHT Height of map the image, in pixels.
FORMAT The format for the map image. Available formats are listed in the GetCapabilities response. For example, image/png.
STYLES Styles in which layers are to be rendered. This value is a comma-separated list of style names. The list may be empty if the default layer styling is used.
TRANSPARENT This is a boolean (optional) parameter. It specifies whether the map background should be transparent. The default value is false.

Using on the information extracted from the metadata records of the GetCapabilities response, we can provide the values for the various parameters of the GetMap request and retrieve an image of the data available through the service. An example GetMap request will look like:

https://gip.itc.utwente.nl/services/world_admin?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=country_borders&CRS=EPSG:4326&BBOX=-90,-180,90,180&WIDTH=1000&HEIGHT=500&FORMAT=image/png&STYLES=

The response to this request is a map image of the specified width and height dimensions, containing the data for the layers included in the request and covering the area indicated in the bounding box. 1 shows the image produced by the WMS server as a response to the request.

In this case we requested the maximum extent available which resulted in an image of the whole world. Now, suppose we want to zoom in and get an image, not of the whole world, but a close up on a particular country. To achieve that we have to submit a new request with a different bounding box. We need to determine the appropriate values for the BBOX parameter and use them in a new the request. Such a request could be as follows:

https://gip.itc.utwente.nl/services/world_admin?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=country_borders&CRS=EPSG:4326&BBOX=-8.30,-93.82,15.69,-48.74&WIDTH=750&HEIGHT=375&FORMAT=image/png&STYLES=

With the modified set of values, the WMS server generated a different image. Basically, a smaller geographical area with the same data content and dimensions of the previous request. 2 shows the response to this new request.

Create your own set of GetMap requests. One to obtain an image that focuses on The Netherlands, and a second one that produces an image focusing on your home Country.

Optionally, if you feel like taking a challenge, try to adjust the WIDTH and HEIGHT parameters in combination with the BBOX parameter to obtain the best image fit. Notice that these three parameters have an aspect ratio relationship (see 3).

Form the GetCapabilities response we know that there are various datasets available through this service. If we want to request more than one layer, we simple create a comma separated list of layer names in the LAYERS parameter of the request. Try the request below in one of your browser tabs.

https://gip.itc.utwente.nl/services/world_admin?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=country_borders,country&CRS=EPSG:4326&BBOX=-90,-180,90,180&WIDTH=1000&HEIGHT=500&FORMAT=image/png&STYLES=

Create a request that shows the country boundaries with a different visual style, so that you obtain an image similar to the one depicted in 4

GetFeatureInfo Request

Returns information associated with a given coordinate of the map image if the requested layer is ‘queryable’. The response contains the underlying data, including geometry and attribute values, for a given pixel location on a map. This request uses an (x,y) pixel value from a previously returned WMS image. 3 shows the specific parameters of the GetFeatureInfo request.

Parameters of the WMS GetFeatureInfo request

ParameterValue Description
SERVICE In this case the value is WMS telling the server which service request is coming.
VERSION Specifies what version of the WMS service specification is being requested, 1.0.01.1.01.1.11.3.0.
REQUEST Tells the WMS server which operation is being requested. In this case, GetFeatureInfo.
QUERY_LAYERS The value is a comma-separated list of the names of the layers to be queried.
INFO_FORMAT MIME type for the content of the response. Possible values include text/plaintext/htmlapplication/jsonapplication/vnd.ogc.gml/3.1.1. This parameter is optional. The GetCapabilities response will show which formats are available.
X Pixel column point on the map. 0 is left side.
Y Pixel row on the map. 0 is the top.
FEATURE_COUNT Maximum number of features to return. Default is 1. This parameter is optional.

To create a GetFeatureInfo request, the parameters in 3 have to be combined with those of the GetMap request that provides the base image for the query. The X and Y pixel coordinates of the request are based on the pixels of that image. This is an example GetFeatureInfo request

https://gip.itc.utwente.nl/services/world_admin?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&LAYERS=country_borders&CRS=EPSG:4326&BBOX=-90,-180,90,180&WIDTH=1000&HEIGHT=500&FORMAT=image/png&STYLES=&QUERY_LAYERS=country_borders&X=300&Y=240

The content of the corresponding response is shown in 3. The format in this case is text/plain