This service is based on the standard OGC Web Mapping Service (https://www.ogc.org/standard/wms/). The base URL as specified in the next section can be copied without any further parameters into a WMS browser (such as QGis or ArcMap) that supports WMS versions 1.1.0, 1.1.1 or 1.3.0. The browser should then be able to show you a list of available layers that can be displayed.
Our WMS service only supports one layer at a time, so care needs to be taken to only select one in your WMS browser.
The WMS imagery can be viewed in either JPEG or PNG format (PNG format supports transparency – where there is no Aerial Photography). Many WMS browsers allow you to select your preferred format.
The imagery was originally flown in the OSGB (British National Grid) projection (EPSG:27700) but this service also supports WGS84 (EPSG:4326) and Web Mercator (EPSG:3857 or EPSG:900913). Some WMS browsers allow you to select a preferred projection.
Base URL
The service starts with the following base URL:
https://www.getmapping.com/GmWMS/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/gb.wmsx
You will be supplied a key which will need to be used in place of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
Parameters
If you are using a WMS browser (such as ArcMap or QGis) then you will not need to read through this section as the WMS browser will automatically build these requests for you.
WMS imagery, or a list of available imagery layers, can be requested directly from a web browser (or from withing custom built software) by building a query string from the parameters listed below and adding them to the base URL (after a question mark). An example is given at the end of this section. The whole URL can then be sent as a standard HTML request.
Values after the equals sign for each parameter are case sensitive.
Service=WMS
This must always be present in every request.
Version=
This can be set to Version=1.1.0 or Version=1.1.1 or Version=1.3.0
Request=
To get a list of the available layers then you just need to add the command:
Request=GetCapabilities
XML should be returned with this request and the layers that can be called are inside each <Layer> tab – you will need the contents of the <Name> tab in further calls for mapping.
No more parameters need to be added if you are making a GetCapabilities request.
To get imagery the following commands need to be added to the Service=WMS and Version parameters:
Request=GetMap
This parameter specifies imagery should be returned.
Styles=
This needs to be included for the WMS standard. However, styling is not relevant for this feed so does not need any value after the =.
Format=
This can either be FORMAT=image/jpeg or FORMAT=image/png
Layers=
This will be the layer name retrieved from the GetCapabilities request above. Our WMS only supports calling one layer at a time. An example would be Layers=composite_best_UK_250mm
The layer names are case sensitive.
BGColor=
BGColor=0xFFFFFF
This is a hexadecimal value that gives the colour of the background where imagery is not present. The above example is a white background. This is an RGB colour where the first two values are for the Red component the second two for the Green and the final two for Blue. Values go in hexadecimal from 00 to FF, where 00 is no colour and FF the maximum amount.
Transparent=
This can be set to TRUE or FALSE. If set to TRUE, when calling a PNG image, then the background colour specified above will be set to transparent. This does not work with JPEGs as they do not support transparency.
SRS= or CRS=
The SRS parameter must be used if Version= was set to 1.1.0 or 1.1.1
The CRS parameter must be used instead if the Version was set to 1.3.0
These parameters use the same values they can be set to: =EPSG:27700 for the OS Great Britain projection, =EPSG:4326 for the WGS84 projection and =EPSG:3857 (or =EPSG:900913) for the Google Web Mercator projection.
BBOX=
This is a comma separated list of number giving the corner co-ordinates for the required image. It follows the format =MinX,MinY,MaxX,MaxY. Actual co-ordinates values depend on the SRS\CRS parameter. If EPSG:4326 is used in version 1.3.0 then the X and Y co-ordinates have to be swapped over (so it actually follows the format =MinY,MinX,MaxY,MaxX).
Width=
This is an integer and specifies the width of the image in pixels. The maximum size for our WMS is 4000px.
Height=
This is an integer and specifies the height of the image in pixels. The maximum size for our WMS is 4000px. The combination of bbox and height and width parameters dictate the resolution of the returned imagery. Our actual photography (rather than coverage maps or older coverage imagery) is displayed at resolutions better than 16m. As an example to get imagery for a 1000px by 1000px image at 15m resolution in either the GB or Google projection you would need a MaxX value that is the MinX + 15000m and a MaxY value that is MinY + 15000m.
The following is an example of a WMS GetCapabilities request (UUUUU and PPPPP will need to be replaced with actual authentication details):
https://www.getmapping.com/GmWMS/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/gb.wmsx?service=WMS&request=GetCapabilities&version=1.3.0
The following is an example of a WMS image request:
https://www.getmapping.com/GmWMS/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/gb.wmsx?service=WMS&request=GetMap&layers=composite_best_UK_250mm&CRS=EPSG:27700&styles=&Format=image/jpeg&version=1.3.0&BGColor=0xFFFFFF&Transparent=FALSE&height=500&width=500&BBOX=529531.3,179156.6,529631.3,179256.6
Exceptions
WMS exceptions are returned as XML in this service. Below are two examples of how such an exception will be returned:
In WMS version 1.3.0:
<ServiceExceptionReport xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
<ServiceException code="LayerNotDefined">
<![CDATA[ Invalid layer name requested. ]]>
</ServiceException>
</ServiceExceptionReport>
In WMS versions 1.1.1 and 1.1.0:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://www.digitalearth.gov/wmt/xml/exception_1_1_0.dtd">
<ServiceExceptionReport version="1.1.0">
<ServiceException>
<![CDATA[Invalid layer name requested.]]>
</ServiceException>
</ServiceExceptionReport>
The Error message is contained within the tag ServiceException. This tag can also have an optional code attribute which can help identify which parameter has an issue. These code attribute values are defined in the OGC WMS 1.3.0 specification (this can be obtained from the OGC website at https://www.ogc.org/standard/wms/). Some exceptions will not have this attribute.
As this service is a web-based service there is also the possibility of standard HTML errors being returned.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article