QGIS supports WMS and WFS as data sources.
The Open Geospatial Consortium (OGC), is an international organization with more than 300 commercial, governmental, nonprofit and research organizations worldwide. Its members develop and implement standards for geospatial content and services, GIS data processing and exchange.
Describing a basic data model for geographic features an increasing number of specifications are developed to serve specific needs for interoperable location and geospatial technology, including GIS. Further information can be found under http://www.opengeospatial.org/.
Important OGC specifications are:
OGC services are increasingly being used to exchange geospatial data between different GIS implementations and data stores. QGIS can now deal with three of the above specifications, being SFS (through support of the PostgreSQL / PostGIS data provider, see Section PostGIS Layers), WFS and WMS as a client.
QGIS currently can act as a WMS client that understands WMS 1.1, 1.1.1 and 1.3 servers. It has particularly been tested against publicly accessible servers such as DEMIS.
WMS servers act upon requests by the client (e.g. QGIS) for a raster map with a given extent, set of layers, symbolization style, and transparency. The WMS server then consults its local data sources, rasterizes the map, and sends it back to the client in a raster format. For QGIS this would typically be JPEG or PNG.
WMS is generically a REST (Representational State Transfer) service rather than a fully-blown Web Service. As such, you can actually take the URLs generated by QGIS and use them in a web browser to retrieve the same images that QGIS uses internally. This can be useful for troubleshooting, as there are several brands of WMS servers in the market and they all have their own interpretation of the WMS standard.
WMS layers can be added quite simply, as long as you know the URL to access the WMS server, you have a serviceable connection to that server, and the server understands HTTP as the data transport mechanism.
The first time you use the WMS feature, there are no servers defined.
Begin by clicking the Add WMS layer button inside the
toolbar, or through the Layer ‣ Add WMS Layer... menu.
The dialog Add Layer(s) from a Server for adding layers from the WMS server appears. You can add some servers to play with by clicking the [Add default servers] button. This will add two WMS demo servers for you to use, the WMS servers of the DM Solutions Group and Lizardtech. To define a new WMS server in the tab Layers, select the [New] button. Then enter the parameters to connect to your desired WMS server, as listed in table_OGC_1:
Name | A name for this connection. This name will be used in the Server Connections drop-down box so that you can distinguish it from other WMS Servers. |
URL | URL of the server providing the data. This must be a resolvable host name; the same format as you would use to open a telnet connection or ping a host. |
Username | Username to access a secured WMS-server. This parameter is optional. |
Password | Password for a basic authenticated WMS-server. This parameter is optional. |
Ignore GetMap URI | ![]() |
Ignore GetFeatureInfo URI | ![]() |
Table OGC 1: WMS Connection Parameters
If you need to set up a proxy-server to be able to receive WMS-services from the
internet, you can add your proxy-server in the options. Choose menu
Settings ‣ Options and click on the tab Network & Proxy.
There you can add your proxy-settings and enable them by setting the
Use proxy for web access. Make sure that you select the correct
proxy type from the Proxy type
dropdown menu.
Once the new WMS Server connection has been created, it will be preserved for future QGIS sessions.
Tip
On WMS Server URLs
Be sure, when entering in the WMS server URL, that you have the base URL. For example, you shouldn’t have fragments such as request=GetCapabilities or version=1.0.0 in your URL.
Once you have successfully filled in your parameters you can select the [Connect] button to retrieve the capabilities of the selected server. This includes the Image encoding, Layers, Layer Styles and Projections. Since this is a network operation, the speed of the response depends on the quality of your network connection to the WMS server. While downloading data from the WMS server, the download progress is visualized in the left bottom of the WMS dialog.
Your screen should now look a bit like figure_OGR_1, which shows the response provided by the DM Solutions Group WMS server.
Figure OGR 1:
Image Encoding
The Image encoding section now lists the formats that are supported by both the client and server. Choose one depending on your image accuracy requirements.
Tip
Image Encoding
You will typically find that a WMS server offers you the choice of JPEG or PNG image encoding. JPEG is a lossy compression format, whereas PNG faithfully reproduces the raw raster data.
Use JPEG if you expect the WMS data to be photographic in nature and/or you don’t mind some loss in picture quality. This trade-off typically reduces by 5 times the data transfer requirement compared to PNG.
Use PNG if you want precise representations of the original data, and you don’t mind the increased data transfer requirements.
Options
The Options field provides a text field where you can add a Layer name for the WMS-layer. This name will be presented in the legend after loading the layer.
Below the layer name you can define Tile size, if you want to set tile sizes (eg. 256x256) to split up the WMS request into multiple requests.
The Feature limit for GetFeatureInfo defines what features from the server to query.
If you select a WMS from the list a field with the default projection, provided by the mapserver, appears. If the [Change...] button is active, you can click on it and change the default projection of the WMS to another CRS, provided by the WMS server.
Layer Order
The tab Layer Order lists the selected layers available from the current connected WMS server. You may notice that some layers are expandable, this means that the layer can be displayed in a choice of image styles.
You can select several layers at once, but only one image style per layer. When several layers are selected, they will be combined at the WMS Server and transmitted to QGIS in one go.
Tip
WMS Layer Ordering
WMS layers rendered by a server are overlaid in the order listed in the Layers section, from top to bottom of the list. If you want to change the overlay order, you can use the tab Layer Order.
Transparency
In this version of QGIS, the Global transparency setting from the Layer Properties is hard-coded to be always on, where available.
Tip
WMS Layer Transparency
The availability of WMS image transparency depends on the image encoding used: PNG and GIF support transparency, whilst JPEG leaves it unsupported.
Coordinate Reference System
A Coordinate Reference System (CRS) is the OGC terminology for a QGIS Projection.
Each WMS Layer can be presented in multiple CRSs, depending on the capability of the WMS server.
To choose a CRS, select [Change...] and a dialog similar to Figure Projection 3 in Working with Projections will appear. The main difference with the WMS version of the screen is that only those CRSs supported by the WMS Server will be shown.
Within QGIS you can search for WMS-servers. Figure_OGC_2 shows the tab Server Search with the Add Layer(s) from a Server dialog.
Figure OGR 2:
As you can see it is possible to enter a search-string in the text field and hit the [Search] button. After a short while the search result will be populated into the list below the text field. Browse the result list and inspect your search results within the table. To visualize the results, select a table entry, press the [Add selected row to WMS-list] button and change back to the tab Layers. QGIS automatically has updated your server list and the selected search result is already enabled in the list of saved WMS-servers in the Layers tab. You only need to request the list of layers by clicking the [Connect] button. This option is quite handy when you want to search maps by specific keywords.
Basically this option is a frontend to the API of http://geopole.org.
When using WMS-C (Cached WMS) Services like http://labs.metacarta.com/wms-c/Basic.py you are able to browse through the tab Tilesets given by the server. Additional information like tile size, formats and supported CRS are listed in this table. In combination with this feature you can use the tile scale slider from the View ‣ Tile scale slider, which gives you the available scales from the tileserver with nice slider docked in.
Once you have added a WMS server, and if any layer from a WMS server is queryable,
you can then use the Identify tool to select a pixel on
the map canvas. A query is made to the WMS server for each selection made.
The results of the query are returned in plain text. The formatting of this text
is dependent on the particular WMS server used.
Viewing Properties
Once you have added a WMS server, you can view its properties by right-clicking on it in the legend, and selecting Properties.
Metadata Tab
The tab Metadata displays a wealth of information about the WMS server, generally collected from the Capabilities statement returned from that server. Many definitions can be cleaned by reading the WMS standards (see OPEN-GEOSPATIAL-CONSORTIUM Literature and Web References), but here are a few handy definitions:
Not all possible WMS Client functionality had been included in this version of QGIS. Some of the more notable exceptions follow.
Editing WMS Layer Settings
Once you’ve completed the Add WMS layer procedure,
there is no ability to change the settings. A workaround is to delete the layer
completely and start again.
WMS Servers Requiring Authentication
Currently public accessible and secured WMS-services are supported. The secured WMS-servers can be accessed by public authentication. You can add the (optional) credentials when you add a WMS-server. See section Selecting WMS Servers for details.
Tip
Accessing secured OGC-layers
If you need to access secured layers with other secured methods than basic authentication, you could use InteProxy as a transparent proxy, which does support several authentication methods. More information can be found at the InteProxy manual found on the website http://inteproxy.wald.intevation.org.
Tip
QGIS WMS Mapserver
From Version 1.7.0 QGIS has its own implementation of a WMS 1.3.0 Mapserver. Read more about this at chapter QGIS Server.
In QGIS, a WFS layer behaves pretty much like any other vector layer. You can identify and select features and view the attribute table. Since QGIS 1.6 editing (WFS-T) is also supported.
In general adding a WFS layer is very similar to the procedure used with WMS. The difference is there are no default servers defined, so we have to add our own.
Loading a WFS Layer
As an example we use the DM Solutions WFS server and display a layer. The URL is: http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap
Note that proxy-settings you have set in your preferences are also recognized.
Figure OGR 3:
You’ll notice the download progress is visualized in the left bottom of the QGIS main window. Once the layer is loaded, you can identify and select a province or two and view the attribute table.
Only WFS 1.0.0 is supported. At this point there have not been many tests against WFS versions implemented in other WFS-servers. If you encounter problems with any other WFS-server, please do not hesitate to contact the development team. Please refer to Section Mailing lists for further information about the mailinglists.
Tip
Finding WFS Servers
You can find additional WFS servers by using Google or your favorite search engine. There are a number of lists with public URLs, some of them maintained and some not.