Written and maintained by CASRAI Editorial Board
Published
On this page
A Web Map Service (WMS) is an Open Geospatial Consortium (OGC) standard that lets a client request a map as a ready-made image, such as a PNG or JPEG, over a simple HTTP interface from one or more distributed geospatial databases. The client sends a URL with parameters (which layers, which area, what image size) and the server answers with a picture, not with the underlying data. The standard is published as OGC 06-042, version 1.3.0, and the OGC states that WMS 1.3 and ISO 19128 are the same document.
What is a Web Map Service (WMS)?
The OGC lists the standard as the “OpenGIS Web Map Service (WMS) Implementation Specification”, document 06-042, an implementation standard at version 1.3.0 (OGC WMS standard page). The OSGeo overview describes the service as a simple HTTP interface for requesting geo-registered map images, delivered in formats such as JPEG and PNG, and notes that it is implemented in hundreds of products (OSGeo WMS overview).
The practical consequence is that a WMS is a rendering service. It is the right interface when a researcher, a portal or a web map needs to display a layer that someone else maintains: land cover, boundaries, imagery, hazard zones. When the analysis needs the vector features or raster values themselves, a WMS image is not enough, and other OGC services exist for that. The web mapping guide compares WMS with WMTS and the other service types; this page concentrates on what a WMS request looks like and how to read it. The OGC itself is covered in our Open Geospatial Consortium guide, and public WMS endpoints are usually advertised through a geoportal.
The three WMS operations: GetCapabilities, GetMap and GetFeatureInfo
A WMS defines three operations. According to the OSGeo overview, GetCapabilities and GetMap are required and GetFeatureInfo is optional.
- GetCapabilities returns service-level metadata. It is the first request to make to an unfamiliar server, because the response describes what the server offers. GeoServer’s reference lists three parameters for it:
service=WMS,versionandrequest=GetCapabilities. - GetMap returns the map image for a requested area, set of layers and image size.
- GetFeatureInfo returns information about the features at a pixel position on a map previously requested with GetMap. In GeoServer it takes all of the GetMap parameters plus
query_layersand a pixel position.
Every request is a plain HTTP GET with key-value pairs, which is why a WMS can be tested by pasting a URL into a browser.
GetMap parameters explained
GeoServer’s WMS reference lists the GetMap parameters that must be present: service, version, request, layers, styles, the coordinate system key, bbox, width, height and format. The data table below sets out every GetMap, GetFeatureInfo and GetCapabilities parameter named in that reference, with its status and default. Three of them cause most of the errors:
layersis a comma-separated list of layer names, andstylesis a comma-separated list of style names in the same order. An emptystylesvalue selects the default style of each layer.bboxis writtenminx,miny,maxx,maxyin the units of the coordinate reference system. It defines the area of the map, not the size of the picture.widthandheightare the size of the returned image in pixels. They set the resolution of the picture; they do not change which area is shown.
The coordinate system key is srs in WMS 1.1.1 and crs in WMS 1.3.0, and the pixel position for GetFeatureInfo is x and y in 1.1.1 but i and j in 1.3.0.
Worked example: decoding a GetMap request
The GeoServer reference gives this sample WMS 1.1.1 request against a local server (the layer is topp:states, a sample layer shipped with GeoServer):
http://localhost:8080/geoserver/wms?request=GetMap&service=WMS&version=1.1.1&layers=topp%3Astates&styles=population&srs=EPSG%3A4326&bbox=-145.15104058007,21.731919794922,-57.154894212888,58.961058642578&width=780&height=330&format=image%2Fpng
Reading it in order: the server is asked for the layer topp:states (the %3A is a URL-encoded colon) drawn in the style population, in the geographic coordinate system EPSG:4326, as a 780 by 330 pixel PNG (image%2Fpng is image/png). The requested area runs from longitude -145.151 to -57.155 and from latitude 21.732 to 58.961.
A useful check is whether the pixel shape matches the map shape. The arithmetic for this request:
- BBOX width: -57.154894212888 – (-145.15104058007) = 87.996146 degrees of longitude.
- BBOX height: 58.961058642578 – 21.731919794922 = 37.229139 degrees of latitude.
- Aspect ratio of the area: 87.996146 / 37.229139 = 2.363636.
- Aspect ratio of the image: 780 / 330 = 2.363636.
- Resolution: 87.996146 / 780 = 0.112816 degrees per pixel horizontally, and 37.229139 / 330 = 0.112816 degrees per pixel vertically.
The two ratios are identical, so one pixel covers the same number of degrees in both directions and the picture is not stretched. When the ratio of width to height differs from the ratio of the BBOX sides, a server may stretch the map to fit, so deriving height from width and the BBOX is good practice. This is the editorial reading of the arithmetic; the reference itself only lists the parameters.
WMS 1.1.1 versus 1.3.0: the axis order trap
The same area can need two different BBOX strings. The GeoServer WMS basics page states that WMS 1.1 always uses east/north (longitude, latitude) axis ordering, whereas WMS 1.3.0 uses the axis order of the coordinate system, which for EPSG:4326 is latitude/longitude. For the whole world, GeoServer’s examples are:
| Version | CRS key and value | BBOX for the whole world |
|---|---|---|
| 1.1.1 | SRS=epsg:4326 |
BBOX=-180,-90,180,90 |
| 1.3.0 | CRS=epsg:4326 |
BBOX=-90,-180,90,180 |
If a layer renders in the wrong place, as an empty image, or as a thin strip, check this before anything else. Sending a 1.1.1 style BBOX with version=1.3.0 and EPSG:4326 swaps latitude and longitude, so the server reads a different area from the one intended.
Common mistakes with WMS requests
- Mixing version keys. Using
srs,xandyin a 1.3.0 request, orcrs,iandjin a 1.1.1 request. Match the keys to theversionvalue. - Reversing the BBOX for 1.3.0. See the table above.
- Leaving out
styles. The parameter is required; send it empty (styles=) to accept each layer’s default style. - Treating the image as data. A WMS returns pixels drawn by the server’s styling. Colours in the image are not measured values, and the map cannot be re-styled client-side unless the server supports the optional styling parameters (GeoServer lists
sldandsld_body). - Ignoring the error format. By default GeoServer returns errors as
application/vnd.ogc.se_xml; if an image is expected and XML arrives, read the XML. Other options arese_inimageandse_blank. - Transparent overlays.
transparentdefaults to false andbgcolorto FFFFFF (white), so an overlay on another map needstransparent=trueand a format that supports transparency, such as PNG.
How to request a WMS map with curl, Python or R
These snippets build the request from the worked example. The host https://example.org/geoserver/wms is a placeholder: substitute the address of the WMS you are using, which GetCapabilities confirms.
curl
curl -G "https://example.org/geoserver/wms" --data-urlencode "service=WMS" --data-urlencode "version=1.1.1" --data-urlencode "request=GetMap" --data-urlencode "layers=topp:states" --data-urlencode "styles=population" --data-urlencode "srs=EPSG:4326" --data-urlencode "bbox=-145.15104058007,21.731919794922,-57.154894212888,58.961058642578" --data-urlencode "width=780" --data-urlencode "height=330" --data-urlencode "format=image/png" -o states.png
Python (standard library)
from urllib.parse import urlencode
from urllib.request import urlretrieve
params = {
"service": "WMS", "version": "1.1.1", "request": "GetMap",
"layers": "topp:states", "styles": "population", "srs": "EPSG:4326",
"bbox": "-145.15104058007,21.731919794922,-57.154894212888,58.961058642578",
"width": 780, "height": 330, "format": "image/png",
}
url = "https://example.org/geoserver/wms?" + urlencode(params)
urlretrieve(url, "states.png")
The urlencode call produces the same encoded query as the sample URL (topp%3Astates, EPSG%3A4326, image%2Fpng).
R (base)
q = c(service = "WMS", version = "1.1.1", request = "GetMap",
layers = "topp:states", styles = "population", srs = "EPSG:4326",
bbox = "-145.15104058007,21.731919794922,-57.154894212888,58.961058642578",
width = "780", height = "330", format = "image/png")
url = paste0("https://example.org/geoserver/wms?",
paste(names(q), vapply(q, URLencode, "", reserved = TRUE),
sep = "=", collapse = "&"))
download.file(url, "states.png", mode = "wb")
When a WMS is and is not the right tool
A WMS fits display: the server does the cartography and the client receives a picture. It does not deliver the raw data behind that picture. For analysis, pair it with the guidance in spatial data analysis, and when a map image has to be aligned to coordinates yourself, see georeferencing in QGIS. The OSGeo overview also lists layer queries (GetFeatureInfo) as the optional route from a picture back to feature attributes.
Sources
- Open Geospatial Consortium: OpenGIS Web Map Service (WMS) standard, checked 2026-11-17
- GeoServer documentation: WMS reference, checked 2026-11-17
- GeoServer documentation: WMS basics, checked 2026-11-17
- OSGeo: Web Map Service overview, checked 2026-11-17
Data: WMS request parameters by operation, as documented for GeoServer
Compilation of the Web Map Service request parameters named in the GeoServer WMS reference for GetCapabilities, GetMap and GetFeatureInfo, with their required or optional status, defaults and the WMS 1.1.1 versus 1.3.0 key differences. Compiled from the GeoServer WMS reference and cross-checked against the OSGeo WMS overview for the operation list.
| Parameter | Operation | Status | Value rule or default |
|---|---|---|---|
| service | All three operations | Required | Value WMS |
| version | All three operations | Required | Protocol version, for example 1.1.1 or 1.3.0 |
| request | All three operations | Required | GetCapabilities, GetMap or GetFeatureInfo |
| layers | GetMap | Required | Comma-separated list of layer names |
| styles | GetMap | Required | Comma-separated list of styles; empty selects the default style |
| srs (1.1.1) or crs (1.3.0) | GetMap | Required | Coordinate reference system, for example EPSG:4326 |
| bbox | GetMap | Required | minx,miny,maxx,maxy in units of the coordinate reference system |
| width | GetMap | Required | Image width in pixels |
| height | GetMap | Required | Image height in pixels |
| format | GetMap | Required | Image format, for example image/png |
| transparent | GetMap | Optional | Default false |
| bgcolor | GetMap | Optional | RRGGBB colour, default FFFFFF |
| exceptions | GetMap | Optional | Default application/vnd.ogc.se_xml; also se_inimage and se_blank |
| time | GetMap | Optional | Optional time selection |
| sld, sld_body | GetMap | Optional | Styled layer descriptor supplied by reference or inline |
| query_layers | GetFeatureInfo | Required | Layers to query, in addition to the GetMap parameters |
| x, y (1.1.1) or i, j (1.3.0) | GetFeatureInfo | Required | Pixel position on the map image |
| info_format | GetFeatureInfo | Optional | Default TEXT; also GML2, GML3, HTML, JSON, JSONP |
| feature_count | GetFeatureInfo | Optional | Default 1 |
Sources
- GeoServer documentation: WMS reference (accessed 2026-11-17)
- OSGeo: Web Map Service overview (accessed 2026-11-17)
- Open Geospatial Consortium: OpenGIS Web Map Service (WMS) standard (accessed 2026-11-17)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







