This post will demonstrate how to load raster files from WMS/WMNTS servers to QGIS 2.8.1.
For this demonstration, we will be doing two things-
1- Importing a GeoTiff file for storage in the Web mapping server as a WMS enabled layer
2. Connecting the WMS to QGIS Desktop and adding the WMS layer
Download a sample of a GeoTIFF image by clicking the link below:
Import GeoTIFF file to a WMS – Geoserver 2.8.2 and publish as a WMS layer
1. We copy the raster geotiff from the location on file
2. Navigate to directory- C:/Program files/Geoserver 2.8.2/data dir/data
Create a new folder and place the geotiff file in it. Our folder is named Ibadan.
3. Log into Geoserver and click on ‘Add stores’ (See cursor finger in screenshot below)
4. In the new page, go down to Raster Data Sources and click on ‘GeoTIFF’
5. You can select any workspace from the dropdown list. For this demo, we choose nurc.
Using the browse button allows you to navigate to the location of the file on disk and load in. Click Save to add the data.
6. Next, the ‘New Layer’ page below will appear. Click ‘Publish’ to create the layer.
The file is now taken from the storage and published to the server as a layer.
7. Next is the ‘Edit Layer’ page. Scroll down this page to inspect the Coordinate Reference Systems. Normally for GeoTIFF files, all the parameters will be defined automatically from the Data source.
Make sure the parameters are in order.
8. If okay with the parameters, scroll down the ‘Edit Layer’ page and click save button to
publish as a layer.
9. On the Left hand side bar, click on ‘Layer Preview’. (see cursor finger position on the screenshot below)Use the Search bar to look for the layer just created.
10. Click on the ‘OpenLayers’ option to preview.
11. A preview of the layer comes up. Copy the URL address on this page.
Adding the WMS layer in Geoserver to QGIS Desktop
In the previous section, we have imported the geotiff file to Geoserver and stored it as a WMS layer. This section, we will load the layer into QGIS Desktop.
1. Launch QGIS Desktop and click on the ‘Add WMS/WMTS Layer’ icon button on
the main menu bar
2. In the dialog window that opens, we click ‘New’ tab to connect to the server
where the data was stored.
3. Fill details in the Create a new WMS connection dialog box.
Give the connection a name- geoserver2, paste the URL address you copied from the
Geoserver in the URL box.Fill in Username and password. Click Ok to create. These parameters should correspond tothe WMS server configuration you will use. Like I said earlier, this demo is using Geoserver 2.8.2.
4. Once created, select it from dropdown list and click ‘Connect tab’
5. Once successfully connected, the layers will appear. Select the layer of interest- Ibdsection. Click Add button to load the layer into QGIS.
6. The WMS Layer is now displayed on the map canvas. Check that the coordinates are correct.
Thank you for following our blog.