Intro to Web GIS APIs and OGC Standards (WMS, WFS, WMTS)

Intro to Web GIS APIs and OGC Standards (WMS, WFS, WMTS)

For the first few years of my career, sharing a map with another organization meant burning a CD. Later it meant emailing a zipped folder of Shapefiles, followed by a phone call to explain which coordinate system they used and why the attribute names looked odd. The recipient would copy the data, and within a month it was out of date. Then, one day, a colleague at a neighboring agency said, “Why don’t you just give us the address of your map service?” He typed a web address into his GIS, and my layers appeared on his screen. They were live. When I updated them, his map updated. There was no copying, no zip and no phone call.

That quiet revolution is the subject of this guide. Web services and open standards are what allow different GIS software, different organizations and different countries to share maps and data over the internet as easily as they share web pages. The standards come mostly from the Open Geospatial Consortium (OGC), and the three you will meet first are WMS, WFS and WMTS. Together with a newer family of simple, web-friendly OGC APIs, and with the proprietary APIs of the big platforms, they form the plumbing of modern web GIS.

In this guide I’ll explain what each standard does, show real requests and code, explain the traps (especially the notorious axis order problem), and help you choose the right service for each job. It is a companion to Enterprise GIS & Spatial Databases: PostGIS, Geodatabases, and Server Architecture, which shows where services fit in a system, and to Geospatial Development & Automation: The Ultimate Guide.

Chart: WMS returns map images, WFS returns vector features, and WMTS returns pre-rendered tiles.
WMS returns map images, WFS returns vector features, and WMTS returns pre-rendered tiles.

Why Standards Matter

Imagine if every website used its own private protocol. You would need a different browser for each. Geospatial services avoid that fate through standards: agreed rules for requesting and delivering geographic data.

  • Interoperability: software from different vendors can talk to each other. QGIS can read a service published by GeoServer, ArcGIS or MapServer.
  • Freedom from lock-in: your data isn’t trapped in one product.
  • Reuse: publish once, use in desktop GIS, web maps, scripts and apps.
  • Always current: consumers see the live data, not a stale copy.
  • Scalability and control: the data stays at the source, where you manage security and quality.
  • Regulation: many governments, such as under European spatial data rules, require that public data be offered through standard services.

The principle runs through Best Free and Open-Source GIS Tools and Open Data Portals by Country: open standards keep the ecosystem healthy.


The Big Picture: Maps, Features, Tiles and Coverages

Different services deliver different kinds of geographic content. Understanding the distinction is the key to the whole subject.

You want…Content typeTypical standard
A picture of a map, drawn by the serverRendered map imageWMS
Fast, pre-drawn map squares for a web mapTilesWMTS (and XYZ tiles)
The real vector data, with geometry and attributesFeaturesWFS, OGC API – Features
Raster data as values, not picturesCoveragesWCS, OGC API – Coverages
To run a geoprocessing task on the serverProcessesWPS, OGC API – Processes
To search for datasets and servicesMetadata catalogsCSW, OGC API – Records
To find satellite scenes and rastersAssets catalogsSTAC

This distinction recalls the vector versus raster difference in Vector vs. Raster Data: The Complete Guide: WMS and WMTS give you pictures, whereas WFS gives you data.


WMS: Web Map Service

What it is

A Web Map Service produces map images on demand. You send a request saying which layers you want, which area, which coordinate system and what image size, and the server draws the map and returns it as a PNG or JPEG. You can’t edit or analyze the result, but you see exactly what the server’s styling produces.

The main operations

  • GetCapabilities: returns an XML document describing the service: its layers, supported coordinate systems, formats and extent. This is the “menu” of the service. Always start here.
  • GetMap: returns the map image.
  • GetFeatureInfo: returns information about what is at a clicked pixel, such as the attributes of the feature there. (Only for layers set up to be queryable.)
  • GetLegendGraphic: returns a legend image for a layer (an extension supported by most servers).

An example request

https://example.org/geoserver/wms
  ?service=WMS
  &version=1.3.0
  &request=GetMap
  &layers=city:roads
  &styles=
  &crs=EPSG:3857
  &bbox=-20037508,-20037508,20037508,20037508
  &width=768
  &height=384
  &format=image/png
  &transparent=true

(In practice, the request is a single line. It is broken up here for reading.) Every parameter is a plain name and value in the web address, a style called KVP (key-value pairs). You can paste such a URL in a browser and see the map.

Pros and cons

  • Pros: simple, universally supported, preserves the server’s cartography, works with any client, can serve complex styled maps and imagery.
  • Cons: you receive pictures, not data. Each pan or zoom needs a new rendering, which can be slow under load. Scale and image size must be handled carefully.

Versions

You will meet 1.1.1 (older, very common) and 1.3.0 (current). They differ in small but important ways, such as the name of the coordinate system parameter (srs in 1.1.1, crs in 1.3.0), and, crucially, the axis order, below.


WMTS: Web Map Tile Service

What it is

A Web Map Tile Service delivers pre-rendered tiles: small, fixed-size image squares arranged in a pyramid of zoom levels. Because tiles are generated in advance and cached, WMTS is fast and scalable, which is why it underpins most web basemaps. The idea is described in How to Create a Web Map (Leaflet, Mapbox, OpenLayers).

Key concepts

  • Tile matrix set: the definition of the zoom levels, tile sizes and origin. A very common one is “GoogleMapsCompatible” (also known as WebMercatorQuad), which matches the familiar web map grid in EPSG:3857.
  • Tile matrix: one zoom level.
  • Tile row and tile column: the position of a tile. In WMTS, the order in URLs is row then column (y then x), unlike the common “XYZ” convention of z/x/y.
  • GetCapabilities: lists layers, tile matrix sets, formats and how to build tile addresses.

An example

A RESTful WMTS tile address looks like this:

https://example.org/wmts/1.0.0/city_basemap/default/GoogleMapsCompatible/12/1409/2074.png

where 12 is the zoom level, 1409 is the row, and 2074 is the column. A simpler, informal cousin is the XYZ tile scheme used by many web basemaps:

https://tile.example.org/{z}/{x}/{y}.png

Both deliver tiles; WMTS is the formally standardized version with a capabilities document.

Pros and cons

  • Pros: very fast, cacheable and scalable, supported by all web map libraries.
  • Cons: the map is pre-styled, so you can’t change the look on the fly. Tiles need to be regenerated when data changes. Not suited to data that changes every minute, unless the cache is refreshed.

WFS: Web Feature Service

What it is

A Web Feature Service delivers the actual vector features: geometry and attributes, which clients can query, filter, analyze, style themselves and download. This is the service to use when you want data, not a picture. Some WFS servers also support transactions (WFS-T), which allow clients to insert, update and delete features.

The main operations

  • GetCapabilities: describes the service and its feature types.
  • DescribeFeatureType: returns the schema: field names and types.
  • GetFeature: returns the features, with options to filter by attributes, by area, to limit the number, and to choose the output format and CRS.
  • Transaction: edits features (WFS-T), if enabled.
  • LockFeature: locks features for editing, in some implementations.

An example request

https://example.org/geoserver/ows
  ?service=WFS
  &version=2.0.0
  &request=GetFeature
  &typeNames=city:schools
  &outputFormat=application/json
  &count=100
  &srsName=EPSG:4326

This returns the first hundred school features as GeoJSON. In WFS 1.1.0 the parameter is typeName (singular), and in 2.0.0 it is typeNames, and paging uses count and startIndex rather than maxFeatures. Servers differ in which output formats they support, such as GML, GeoJSON and CSV. GeoServer, for instance, offers GeoJSON through application/json.

Filtering

WFS supports an XML-based filter language (OGC Filter Encoding) to select features by attribute or location. Several servers also accept simpler CQL expressions, which are easier to write in a web address, for example cql_filter=population>10000. CQL support is a server extension, not part of the core standard, so check your server.

Pros and cons

  • Pros: real data, complete attributes, can be filtered, styled and analyzed by the client, and editable via WFS-T. Perfect for desktop GIS and data download.
  • Cons: heavier than images, and large datasets can be slow, so servers often limit the number of features returned. Clients must handle styling. Older GML output is verbose. Editing needs care and security.

WCS and WPS, Briefly

  • WCS (Web Coverage Service) returns raster data as values, not as pictures: elevation, temperature, imagery bands, with the ability to subset by area and bands. Use it when you need to analyze a raster, not just look at it.
  • WPS (Web Processing Service) lets clients run geoprocessing tasks on the server, sending inputs and receiving results. Useful for heavy analysis that is best done where the data lives.

These are less common in everyday work than WMS, WFS and WMTS, but they follow the same pattern: capabilities, then requests.


The Modern Family: OGC APIs

The older services (the “OWS” family) use XML heavily and a request style that feels old to web developers. In recent years, OGC has built a new generation of OGC APIs: simple, RESTful interfaces that return JSON, with links and clear documentation (OpenAPI), designed to be easy for developers and for the modern web.

OGC APIModern replacement for
OGC API – FeaturesWFS: access vector features
OGC API – TilesWMTS: map and vector tiles
OGC API – MapsWMS: rendered map images
OGC API – CoveragesWCS: raster data
OGC API – ProcessesWPS: geoprocessing
OGC API – RecordsCSW: catalogs of metadata
OGC API – EDR (Environmental Data Retrieval)Querying environmental and weather data by position, area or trajectory

The older and newer standards coexist, and many servers, including GeoServer, MapServer, QGIS Server and several open-source projects, support both.

OGC API – Features in practice

The pattern is easy to remember:

  • GET /collections lists the available collections (datasets).
  • GET /collections/schools describes one.
  • GET /collections/schools/items?limit=100&bbox=2.2,48.8,2.5,48.9 returns features as GeoJSON.
  • GET /collections/schools/items/42 returns one feature.
  • Responses include links, such as a next link for paging, so a client simply follows them.

You can paste these addresses in a browser, and the JSON arrives. The format and coordinate order are GeoJSON’s, longitude first, which sidesteps most axis order problems. Other advanced options include filtering by property with CQL2, and requesting other coordinate systems.


STAC: A Catalog for Imagery

STAC (SpatioTemporal Asset Catalog) is a lightweight JSON standard and API for describing and searching satellite imagery and other geospatial assets, by area, date and properties such as cloud cover. A search returns items, each pointing to the actual files (assets), typically cloud-optimized GeoTIFFs. It has become the standard way to discover Earth observation data in the cloud, as seen in Raster Processing in Python: Rasterio, Xarray, and NDVI from Code and Satellite Imagery Sources: Free vs. Paid. STAC is not an OGC standard in the strict sense, but it works closely with OGC APIs.


The Axis Order Trap

This single issue causes more confusion than all the others combined, so let me give it a section of its own.

Geographic coordinates have two components, latitude and longitude, and different standards write them in different orders.

  • Latitude, longitude (y, x): how most people speak, and how the official definition of EPSG:4326 is written.
  • Longitude, latitude (x, y): how GIS software and GeoJSON have traditionally stored and written them.

The consequences for services:

  • In WMS 1.1.1, bounding boxes are always x, y order: bbox=minLon,minLat,maxLon,maxLat.
  • In WMS 1.3.0, the axis order follows the coordinate system’s official definition. For EPSG:4326, that means latitude first: bbox=minLat,minLon,maxLat,maxLon. For projected systems such as EPSG:3857 and UTM, the order is x then y, so nothing changes.
  • In WFS 1.1.0 and 2.0.0, coordinates in GML follow similar rules, and the way you write the CRS, such as EPSG:4326 versus urn:ogc:def:crs:EPSG::4326, can change the order the server uses.
  • GeoJSON (RFC 7946) is always longitude, latitude.

Symptoms

A map that is empty, or in the wrong place, or flipped across the diagonal, or a service that returns an error about an invalid bounding box. The data exist, but the request asks for the wrong place.

How to avoid it

  • Read the GetCapabilities document and the server’s documentation for the supported CRSs and the axis order they use.
  • For WMS 1.3.0 with EPSG:4326, put latitude first, or use CRS:84 (the same datum with longitude first, defined to avoid this very problem).
  • Prefer EPSG:3857 or a projected CRS for map requests, where the order is x, y.
  • Use libraries that handle the order for you, and test with a known location.
  • Test with a small, recognizable area, such as a city, before relying on a request.
  • Remember it in code, for example always_xy=True in pyproj. See Python for GIS: Getting Started.

Using Services in Practice

In QGIS

  • WMS and WMTS: open the Data Source Manager (Layer > Data Source Manager), choose WMS/WMTS, create a new connection with the service URL, click Connect, select the layers and Add.
  • WFS and OGC API – Features: choose WFS / OGC API – Features in the same manager, and connect to the URL. You can filter, limit the features and then work with the layer as if it were local.
  • Save the connection and share it with colleagues.
  • Add XYZ tiles from the Browser panel, using the tile URL pattern.

In ArcGIS Pro

Add a WMS, WMTS or WFS server connection from the Insert tab’s Connections options (a server connection), and add layers to your map. ArcGIS also has its own REST services, described below.

In Python

OWSLib speaks the classic OGC services:

from owslib.wms import WebMapService

wms = WebMapService("https://example.org/geoserver/wms", version="1.3.0")
print(list(wms.contents))                      # the layers available

img = wms.getmap(
    layers=["city:roads"],
    styles=[""],
    srs="EPSG:3857",
    bbox=(255000, 6250000, 270000, 6265000),   # x, y order for a projected CRS
    size=(800, 800),
    format="image/png",
    transparent=True,
)
with open("roads.png", "wb") as f:
    f.write(img.read())
from owslib.wfs import WebFeatureService

wfs = WebFeatureService("https://example.org/geoserver/ows", version="2.0.0")
print(list(wfs.contents))                      # feature types

response = wfs.getfeature(typename="city:schools", outputFormat="application/json", maxfeatures=200)
with open("schools.geojson", "wb") as f:
    f.write(response.read())

GeoPandas can read a WFS request that returns GeoJSON straight into a GeoDataFrame:

import geopandas as gpd

url = ("https://example.org/geoserver/ows?service=WFS&version=2.0.0&request=GetFeature"
       "&typeNames=city:schools&outputFormat=application/json&count=500")
schools = gpd.read_file(url)
print(schools.crs, len(schools))

OGC API – Features is just HTTP and JSON, so the requests library is enough:

import requests

base = "https://example.org/ogcapi/collections/schools/items"
params = {"limit": 100, "f": "json", "bbox": "2.2,48.8,2.5,48.9"}
data = requests.get(base, params=params, timeout=30).json()

print(len(data["features"]), "features")
# Follow the "next" link to page through the results
next_links = [l["href"] for l in data.get("links", []) if l.get("rel") == "next"]

For the wider Python toolkit, see GeoPandas and Shapely: Vector Data in Python.

With GDAL on the command line

GDAL reads these services directly:

ogrinfo "WFS:https://example.org/geoserver/ows" -so
ogr2ogr -f GPKG schools.gpkg "WFS:https://example.org/geoserver/ows" city:schools

In a web map

Leaflet can display a WMS layer with one line:

L.tileLayer.wms("https://example.org/geoserver/wms", {
  layers: "city:roads",
  format: "image/png",
  transparent: true,
  attribution: "City GIS"
}).addTo(map);

OpenLayers and MapLibre have equivalents for WMS, WMTS and vector tiles. A web map can mix sources freely: a tiled basemap, a WMS overlay and WFS or GeoJSON features for interaction. See How to Create a Web Map (Leaflet, Mapbox, OpenLayers).


Platform APIs: ArcGIS REST and Others

Not every service follows OGC standards. Major platforms offer their own REST APIs, widely used and well documented.

  • ArcGIS REST services: Esri’s map, feature and image services. A feature layer can be queried with a simple web address, for example .../FeatureServer/0/query?where=1=1&outFields=*&f=geojson. ArcGIS servers can also publish OGC services alongside. See Getting Started with ArcGIS Online.
  • Mapbox, Google, HERE and other commercial APIs: maps, geocoding, routing and places, with API keys and usage-based pricing.
  • Geocoding and routing APIs: convert addresses to coordinates and compute routes. See Geocoding: How to Convert Addresses to Coordinates and Network Analysis and Route Optimization.
  • OpenStreetMap services: such as the Overpass API, which queries OSM data. For example, pharmacies in a box:
[out:json][timeout:25];
node["amenity"="pharmacy"](48.8,2.2,48.9,2.5);
out;

(Overpass uses south, west, north, east order for boxes.)

  • GeoJSON and vector tile endpoints, from databases and cloud services.

The same concepts apply: a URL, parameters, a format, authentication and limits.


Publishing Your Own Services

The servers

  • GeoServer: a Java server that publishes WMS, WFS, WMTS, WCS and more, with a web interface and tile caching (GeoWebCache).
  • MapServer: a fast, lightweight server, configured with text files.
  • QGIS Server: publishes your QGIS projects as OGC services, keeping your styling.
  • pg_featureserv, pg_tileserv and similar tools: expose PostGIS tables directly as OGC API – Features and vector tiles.
  • ArcGIS Server and ArcGIS Enterprise: commercial platforms offering OGC and REST services.

These servers appear in Enterprise GIS & Spatial Databases: PostGIS, Geodatabases, and Server Architecture and Best Free and Open-Source GIS Tools.

The typical steps (GeoServer as an example)

  1. Connect to the data source, such as a PostGIS database or a GeoPackage.
  2. Publish a layer: choose the table, set the coordinate system, and check the bounding boxes.
  3. Define a style: the cartography the service will use for WMS.
  4. Set metadata: title, abstract, keywords and contact, to make the service understandable. See Metadata in GIS: Why It Matters and How to Create It.
  5. Enable the services you want, and set limits, such as the maximum number of features returned.
  6. Cache tiles for heavy layers.
  7. Secure it: decide who can read, and who can edit, and test.
  8. Test with several clients: QGIS, a browser, a script.
  9. Monitor and maintain.

Good Practice for Service Providers and Consumers

For providers

  • Describe the service well: meaningful layer names and titles, abstracts, keywords, contact and license in the capabilities.
  • Offer the CRSs people need: at least the native one, EPSG:4326 and EPSG:3857, and any national system.
  • Set sensible limits on features per request and image size, to protect the server.
  • Use tile caching for popular layers.
  • Provide a stable address, and avoid breaking changes without notice.
  • Document licensing and update frequency.
  • Secure editing services, and never expose WFS-T to the public without authentication.
  • Enable CORS if browser-based clients from other websites need access.
  • Serve over HTTPS.
  • Monitor usage and performance.
  • Choose the right service for the data: tiles for basemaps, WFS or OGC API for data, and WMS for styled maps.

For consumers

  • Start with GetCapabilities (or the collections list) to see what exists.
  • Respect usage limits and licenses, and give credit.
  • Don’t hammer a server. Cache, page and use tiles.
  • Handle the axis order and CRS carefully.
  • Request only what you need: a bounding box, specific properties, a limited count.
  • Prefer data services for analysis, and map services for display.
  • Cache important data locally if you depend on it, because services can change or disappear.
  • Handle errors: timeouts, empty results and version differences.
  • Record the source and date of every service you use.

Troubleshooting

SymptomLikely causeWhat to try
WMS returns a blank or transparent imageWrong bounding box or axis order, wrong layer name, or no data in that areaCheck the capabilities, the order of the bbox and the CRS. Try a known extent
An XML error instead of an imageThe server is complaining about a parameterRead the error text. It usually names the problem
Layers appear shifted or flippedAxis order mismatchSwap the order for EPSG:4326 in WMS 1.3.0, or use a projected CRS
Only 1,000 features appear from WFSA server limit on features per requestPage with count and startIndex, or increase the limit if you manage the server
Browser console shows a CORS errorThe server does not allow cross-origin requestsEnable CORS on the server, or use a proxy
Mixed content blockedAn HTTP service called from an HTTPS pageServe the service over HTTPS
401 or 403 errorAuthentication or permissionsCheck keys, tokens and roles
The service is very slowRendering on demand under load, or huge unindexed dataUse tile caching, spatial indexes and scale-dependent rendering
Attribute names look different or are truncatedThe source format has limits, or the server renames fieldsCheck DescribeFeatureType, and the source data
A coordinate system is not supportedThe server doesn’t offer that CRSRequest a supported CRS, and reproject on your side
Version errorsClient and server disagree about the versionSpecify the version explicitly

Many of these problems are exactly what the troubleshooting habits in Top 10 Most Common GIS Errors and How to Fix Them teach: isolate, check the basics (CRS, extent, names) and change one thing at a time.


Security and Privacy

  • Don’t expose what shouldn’t be public. A WFS publishes data, with every attribute. Remove sensitive fields, and generalize locations where necessary.
  • Protect editing. Require authentication for WFS-T, and audit changes.
  • Use API keys and tokens properly, restrict them by domain or address, and never publish secret keys in client code.
  • Rate-limit to prevent abuse.
  • Use HTTPS.
  • Consider personal data. If a service exposes information about individuals, follow the law, and prefer aggregated data.
  • Think about infrastructure: detailed maps of critical infrastructure may need restricted access.

Choosing the Right Service: A Quick Guide

  • I want a ready-made background map for a website: WMTS or XYZ tiles, or vector tiles.
  • I want to show a styled overlay and I don’t care about the data: WMS.
  • I want to download or analyze the actual features: WFS or OGC API – Features.
  • I want to edit data over the web: WFS-T, or the editing services of your platform, with strong security.
  • I want raster values for analysis: WCS, OGC API – Coverages, or cloud-optimized files with STAC.
  • I want to find satellite imagery: STAC.
  • I want to search for datasets: CSW or OGC API – Records, or an open data catalog.
  • I’m building a modern web app: OGC API services, vector tiles and GeoJSON.
  • I need broad compatibility with older software: WMS and WFS.
  • I’m already in an Esri environment: ArcGIS services, plus OGC services for interoperability.

Final Thoughts

Standards are rarely glamorous. Nobody gets excited about a capabilities document. But they are the reason that a map prepared in one country, in one software, can appear on a screen in another, in a different software, a second later. They turned geographic data from something we copy into something we connect to, and that changes how organizations work together.

Start by connecting to a public service. Find a national agency or a city that publishes a WMS or WFS, add it in QGIS, and look at the capabilities. Then request one feature type in Python and load it into a GeoDataFrame. Once you have done that, you will never look at a “download” button the same way again.

Where to go next: explore Enterprise GIS & Spatial Databases: PostGIS, Geodatabases, and Server Architecture to see where services fit in a whole system, and How to Create a Web Map (Leaflet, Mapbox, OpenLayers) to put services on a web page.

Rachid Khouri

Rachid Khouri

Rachid Khouri is a CAD, BIM and GIS professional, Autodesk Authorized Developer, trainer and technical author with more than 30 years of experience, working with AutoCAD since 1992. He founded GISauthority.com to share practical guidance on GIS and spatial technologies.