OGC Web Services

What is WMS or WFS or WMTS? And how do I use them?

Mark George Allen
7 min readMay 7, 2020

There are many web map protocols and standards but for this post I will only be detailing the OGC standards as used by most web-based GIS, namely WMS, WMTS and WFS.

The Open Geospatial Consortium worked on standardizing web-based mapping technologies and released WMS (Web Mapping Service) 1.0.0 in 2000. GIS software was already quite mature at the time, but the internet was still relatively young and there had not been a standard approach for creating maps, map images, cartography, or user movable and zoom-able digital maps through the internet. Google Maps and Bing Maps would not appear for another five years in 2005.

WMS is a framework to allow the consumption of mapping data over the internet. A user can view a mapping area by using a Get request with a bounding box (area of interest), a map layer, a styles list, the service type, the number of pixels of the final image, and the projection system of the map. A WMS allows for the consumption of mapping data when a user has an area of interest, a bounding box of coordinates, and is usually rendered in real time by a spatial server. The user receives an image, either PNG or JPEG, of the bounding box provided. Other parameters were added to the WMS protocol, but the core user case is the same.

https://gis.beacons-npa.gov.uk/geoserver/wms?
service=wms
&REQUEST=GetMap
&layers=inspire:tree_preservation_orders_polygon
&SRS=EPSG:27700
&bbox=323709,218795,324709,219795
&WIDTH=1000&HEIGHT=1000&FORMAT=image/png
Image return from GOV open data

The above WMS GetMap request will return a 1000 by 1000 pixels image from an open data British Government service. The bounding box and the pixel dimensions have to have equal aspect ratios otherwise skewing or stretching of the image will occur. Also note the SRS, Spatial Reference System, that identifies which projection system is used. WMS is not that user-friendly in terms of being able to quickly change the area of interest, or even ensure that no skewing of data is present. In a projected system where coordinates represent metres from an origin point, such as British National Grid, this is much easier. It's easier to calculate the bounding box size and therefore the needed pixel aspect ratio. But in non-projected world based coordinate systems that are based on arcs this is much more difficult. It is therefore much easier to use a GIS program such as QGIS to consume WMS data.

When Google Maps and Bing Maps were established in around 2005, many users wanted to be able to view mapping online as well as pan, zoom and interrogate data (sometimes known as a slippy map). Although you can use a WMS to serve up slippy maps, the WMS standard wasn't designed for it and it can be difficult to work with. WMS is best in one image per Get request scenarios such as static maps. Another useful aspect of WMS is that layers can be combined with the use of a comma separated list. Therefore, it is possible to have one GetMap request return a base map layer and a separate feature layer such as above — tree preservation order data, overlain.

A new protocol was developed in 2010. The WMTS, is a Web Mapping Tiled Service, and shares the same basic premise of WMS except that the images returned are in small tiles of 256 or 512 size and usually pre rendered so that they can be returned very quickly to the user.

Image rendering can be quite taxing on servers especially for complex data sets full of different data types, town and place labels, cartographic styles etc. So being able to pre render small images at different map scales, often called tiles, to be sent over the internet rather than large scene images can drastically improve the speed of the service as well as the stability of the server. These tiles can also be cached on the user side.

Confusingly there is also another tile standard called TMS, Tile Map Service, developed by OSGeo, however TMS is not an OGC registered standard. Many web mapping technologies use TMS however for its simplicity.

The OGC have released many standards, however WMS and WMTS are the main raster(image) based protocols. WFS was released around 2006 and allows a user to interrogate geo spatial data. It allows for the return of vector geometries as well as tabular data corresponding to those geometries. It enabled GIS level data analysis, manipulation and editing all through the web. WFS can be quite resource heavy both on the server and a network due to the amounts of data delivered. Where a WMS only returns a rendered image that is usually compressed and relatively small, WFS may return large amounts of data in GML format. GML is a spatial data format very similar to XML in layout. WFS is very useful for when users need to view, analyse and edit geographic data usually within a GIS program. The WFS protocol allows for geometry and data editing that will save the changes back to the storage medium, usually a spatial database. GML is quite an old format and is not always that easy to use. However, the latest WFS specification version 3 which the OGC are about to release appears to be much more modern and user-friendly being designed around JSON objects, read more here for more details.

Due to the sheer amount of data that can be within a layer, for instance the service used here holds data for the whole of the UK, it is important to use some sort of filter. Usually server managers have a maximum number of features that a GetFeature request will return so as not to tax the servers too much. However, it is best practice for the user to either filter the data using an area of interest, the bbox parameter, or by using the Count/MaxFeature (Count is used in WFS 2.0.0) parameter to reduce the number of features returned. In the example below, the bounding box parameter filters the data response by only returning those features that intersect the bounding box.

https://gis.beacons-npa.gov.uk/geoserver/inspire/ows?service=WFS
&version=2.0.0
&request=GetFeature
&typeName=inspire:public_rights_of_ways
&bbox=323500,218900,324000,219400
Example of WFS data return, data GOV open data

The WCS Web Coverage Service, is a protocol that is similar to WFS, but it allows for a user to interagate spatial data and make a request for raster data. This service is less commonly used, and it usually used for specialist satalite imagery data or other geographical raster based data that can hold information over many years and in different contexts. WCS has more powerful filtering then WMS, and allows for multiple imagery formats and even multi-dimensional data, i.e. multi-year imagery that might show average rainful or tempertures over a time period.

The present and future of web mapping

The OGC protocols are quite old and have helped standardize web mapping over the last twenty years. However, the web has moved on a lot in that time, from mobile, to a greater desire for speed and higher consumption, easier navigation and interrogation of data. Most modern web based maps therefore do not use WMS or WFS and are in the whole moving towards vector tiles. Google Maps, Bing Maps and Mapbox have all moved towards vector tiles which allow for much speedier services as well as lighter traffic to the user. Now that most devices have inbuilt graphics chips it is now far easier to render map images on the user side with greater fidelity than it was when the OGC first established the WMS protocol. With WFS moving towards easier to use JSON data objects maybe WFS will become more relevant again within browser based mapping. But, for now WFS is more useful for use within GIS software.

With the recent move towards vector tile based mapping, there has been an increase in different standards. Many people are using the Protocol Buffers (PB files) which is an open standard created by Mapbox. However, ESRI have also created a slightly different vector tile standard, and some are based solely on GeoJson formats. It will be interesting therefore, to see if the OGC try to standardize vector tiles going forward. Looking at the web currently the Mapbox standard is certainly popular.

Summary

Web Map Service is a protocol designed by the OGC to standardize the delivery of spatial data over the web as images. This standard is now twenty years old and has some limitations. The OGC have released revisions and updates but the serving of raster imagery over the web is quickly being outdated. WFS is a protocol to deliver GIS spatial data over the web and has historically been in GML format but is soon to be updated to JSON in WFS 3.

Tiles services, especially vector based, are likely to be the future of web based mapping.

Further reading and Sources

--

--

Mark George Allen

Map and photo geek. Currently using JavaScript, Ruby, and Python. Interested in Machine Learning, all things Geo Spatial and web map design.