Adding WMS/WFS connections
Introduction
Instead of downloading GIS datasets and storing them on your computer, it is also possible to access data remotely by connecting to a server. This is made possible through web services, which you can connect to using a URL. Some of the main benefits of using web services are that: (1) you no longer need to download and store (large) files on your computer and (2) the data will always be up-to-date.
This tutorial will:
- provide a background on the standards defined for web services
- explain the procedure for adding layers via web services
- provide some examples of how to use some useful web services for the Netherlands
Background
The Open Geospatial Consortium (OGC) defines a number of standards for accessing geospatial data via online servers. An overview of the standards they define is provided below. This tutorial will focus on the most commonly used standards: WMS and WFS.
Overview of web services
OGC standards:
- WMS — Web Map Service
- WMTS — Web Map Tile Service
- WFS — Web Feature Service
- WFS-T — Web Feature Service - Transactional
- WCS — Web Coverage Service
- WPS — Web Processing Service
Other geodata services (available via Esri's ArcGIS server):
- ArcGIS FeatureServer
- ArcGIS MapServer
Web Map Service (WMS)
WMS is a standard for accessing geo-referenced maps via a server. It makes geospatial data available in image format. This standard is generally focused on raster images (mostly in PNG or JPEG format) but it is also possible to obtain data as a vector image in SVG format.
Web Feature Service (WFS)
WFS is a standard for requesting geospatial vector data from a server. Unlike WMS, which returns a map image, WFS returns individual features with their own geometry and attributes. These features can be queried and analysed using QGIS tools, making WFS data more interactive than WMS data.
Procedure
Step 1: Navigate to
and choose the menu item corresponding to the connection you would like to add.- Web Map Service: Add WMS/WMTS Layer...
- Web Feature Service: Add WFS Layer...
- ArcGIS FeatureServer: Add ArcGIS FeatureServer Layer...
- etc...
Step 2: In the window that opens, click the "New" button.
Step 3: Fill in a name for the new connection, paste the URL and Click "OK". See the next section of this tutorial for some examples of where to find URLs.
Step 4: Click the "Connect" button. The layers that are available via the URL that you filled in will be listed.
Step 5: Select the layer(s) that you would like to add to the project.
Step 6 — for WFS layers only: Select "only request features overlapping the view extent" so that data will only be downloaded for the current map canvas extent (optional but recommended).
Step 7: Click "Add" and you will see the layer(s) added to your project.
Note: Keep in mind that web services work through a connection to a server. This means that whenever you zoom/pan to change the map view, a new request will be sent to the server and the data will be loaded again. This can lead to some delays. For data loaded via a WFS connection, you can export the layer(s) as a GeoPackage or Shapefile so that the data is stored locally on your computer. This will also allow you to edit the data. See this page for a tutorial on how to export layers.
Useful web services NL
This section provides an overview of some useful web services for datasets in the Netherlands. Use the links provided below to access the URL of each web service. You can find more datasets on PDOK, which is the main geospatial data platform of the Netherlands: https://www.pdok.nl/.
Dataset abbreviations:
- BGT = Basisregistratie Grootschalige Topografie
- BAG = Basisregistratie Adressen en Gebouwen
- NWB = Nationaal Wegenbestand
WMS connections
Map image | Dataset | Link* |
---|---|---|
Aerial photograph of NL | Luchtfoto / PDOK (Open) | https://www.pdok.nl/geo-services/-/article/luchtfoto-pdok |
Topological map of NL | BGT | http://3dbag.bk.tudelft.nl/downloads |
WFS connections
Feature | Dataset | Layer name | Link* |
---|---|---|---|
Building footprints | BAG | pand | https://www.pdok.nl/geo-services/-/article/basisregistratie-adressen-en-gebouwen-ba-1 |
Building footprints (+ height) | 3D BAG | 3D BAG | http://3dbag.bk.tudelft.nl/downloads |
Road network | NWB | wegvakken | https://www.pdok.nl/geo-services/-/article/nationaal-wegen-bestand-nwb- |
*The links provided in the tables above are not the WMS / WFS URLs!
Since these datasets are regularly updated, the URL linked to a specific dataset can change over time depending on the latest version. The latest URL for each dataset can be found by clicking on the link provided and scrolling to find the URL of the web service required.
ArcGIS FeatureServer connections
Currently this is the only way to access a vector format of the BGT dataset. The following URL can be copied directly into QGIS to obtain data from the service: https://basisregistraties.arcgisonline.nl/arcgis/rest/services/BGT/BGT_objecttypen/FeatureServer
The BGT is the topological dataset of the Netherlands. Some examples of the features you can access from this service are provided below.
Feature | Dataset | Layer name |
---|---|---|
Water | BGT | waterdeel_v |
Vegetation | BGT | begroeidTerreindeel_v |
Trees | BGT | vegetatieObject_p |
Examples
This section will provide some examples of how to access open data in the Netherlands using some of the useful web services listed in the section above.
WMS: aerial photograph of NL
Step 1: Go to this webpage and scroll down to the sub-heading Luchtfoto Beeldmateriaal / PDOK 25 cm RGB (WMS). Many of the sub-headings look similar so make sure that you scroll to the right one!
Step 2: Copy the URL from the table below the sub-heading.
Step 3: Open QGIS and navigate to
Step 4: Click "New". In the window that opens, fill in a name and paste the URL. Then, click "OK".
Step 5: Click "Connect" and select the layer(s) you would like to add from the list. The most up-to-date aerial photograph of the Netherlands is the one at the bottom of the list. Change the coordinate reference system to EPSG:28992 - Amersfoort / RD New so that the map will be in the correct CRS for the Netherlands.
Step 6: Click "Add" and you will see the aerial photograph added to the QGIS map canvas.
WFS: buildings of NL
Step 1: Go to this webpage and scroll down to the sub-heading BAGv1.1 (WFS). Many of the sub-headings look similar so make sure that you scroll to the right one!
Step 2: Copy the URL from the table below the sub-heading.
Step 3: Open QGIS and use a base map (such as OpenStreetMap) to zoom and pan to your area of interest (more about how to use OSM as a base map on this page). You can also use the OSM place search plugin to navigate to your area of interest (see this tutorial page).
Step 4: Set the project CRS to EPSG:28992 - Amersfoort / RD New (the coordinate reference system of the Netherlands). More info on coordinate references systems in this tutorial.
Step 5: Navigate to
in the QGIS menu.Step 6: Click "New". In the window that opens, fill in a name and paste the URL. Then, click "OK".
Step 7: Click "Connect" and select the layer(s) you would like to add from the list. The buildings of the Netherlands are stored in the layer "pand". Make sure that "only request features overlapping the view extent" is selected (important because otherwise a request could be made for all buildings in the Netherlands!). Also make sure that the CRS is set to EPSG:28992 - Amersfoort / RD New.
Step 8: Click "Add" and you will see the building polygons added to the QGIS map canvas (depending on the size of area you have requested the features for, it may take some time to load).
If you would like to obtain the same building polygons but with additional information about the building height, then you can use the 3D BAG. You can follow the same steps as outlined here but, instead of creating a connection to the BAG, create a connection to the 3D BAG using the WFS URL from this web page.
Useful links
- Working with WMS data: https://www.qgistutorials.com/en/docs/working_with_wms.html
- QGIS documentation on WMS / WFS (and other OGC specifications): https://docs.qgis.org/3.10/en/docs/user_manual/working_with_ogc/ogc_client_support.html#
- Info about PDOK services and API's (in Dutch): https://www.pdok.nl/services-en-api-s