
Adding base maps
Base maps are ready-to-use background maps that provide contextual and spatial information additional to your data. They can be satellite imagery, general maps from various sources, or even self-prepared custom maps. In this section, we will take a look at the most popular types of background maps and how to load them into QGIS to combine them with your data.
The OpenLayers plugin
This is one of the most popular QGIS plugins, as it allows simple addition of base maps from numerous popular map providers (OpenStreetMap, Google Maps, Bing Maps, and so on). Install the plugin as described in Chapter 1, Handling Your Data, and make sure that it's active after installation.
Loading base maps is simple; go to Web | OpenLayers, select the provider, and click on the map you want to add. The map will be loaded into the map canvas and appear in the Layers panel. By default, layers are added to the first layer group, but you can drag and drop them wherever you want. The layer can be shown or hidden with the toggle beside its name, and deleted from the project with the Remove right-click contextual shortcut.
You can gain extended control over layers and navigation by activating the OpenLayers Overview panel from the menu. The panel will appear in the bottom-left corner under the Layers panel.

Activate the Enable map toggle and select a map for overview from the drop-down list. You can use two different maps in the overview window and the map canvas window for comparison. If you want to load the map into the canvas, click on the Add map button beside the drop-down list. For simpler navigation, there is a red cross in the main map window. It marks the center of the overview extent. You can hide it by clicking on the corresponding toggle. Also, the overview map can be saved as a .jpeg
image, or a rectangular extent can be copied to the clipboard as KML.
The OpenLayers plugin is very useful because of its numerous maps and simplicity, but there are a number of constraints you should pay attention to while working with it. First of all, this plugin is aimed at providing base maps only, and before using it to perform other tasks, it is highly recommended to study the provider's licensing terms. Secondly, note that adding any layer from the plugin's list automatically changes the original map projection to EPSG: 3857 WGS 84 / Pseudo Mercator.
This is because the plugin fetches data originally provided in EPSG: 3857, and instead of reprojecting, it suppresses map projection and automatically reprojects the user's data. Last but not least is the fact that with the OpenLayers plugin, you cannot rely on scale and map measurements. This is because the EPSG: 3857 WGS 84 / Pseudo Mercator projection it uses was designed not to minimize object distortions (shape, area, distance, and so on) but to fit the entire globe in such a way that it could be shown on the web map. All measurements in this projection are performed on a sphere, and will most likely be much larger than expected. In a few words, this projection is good for visual exploration but not for measurements. To overcome these limitations, you can use other approaches.
Adding WMS/WMTS layers
The Web Map Service / Web Map Tile Service (WMS/WMTS) is a popular web-protocol for spatial information transferring To add WMS/WMTS base layer to your map perform the following steps:
- To load data from web services, go to Layer | Add Layer | Add WMS/WMTS, use the corresponding button in the Mange layers toolbar, or use the Ctrl + Shift + W keyboard shortcut.
- In the Add layer(s) from a WM(T)S Server window, click on the New button to configure new connection parameters.
- In Create a new WMS Connection, enter connection details. Type Name and URL for the connection and authentication parameters, if any. After filling in these details, click on OK. A newly created connection will show up in the drop-down list under the Layers tab.
- Click on the Connect button to get information about the available layers, select the layer you want to use, click on Add, and then click on Close to leave the window.
In the case of using WMS-layers, the data will automatically be reprojected. Also, you will have access to the layer's Properties dialog and styling parameters, such as transparency, blending, and color mode available for modification. Of course, these layers are available for creating high-resolution printing maps.
Adding TMS layers
The Tile Map Service (TMS) is another way of providing spatial data through the Internet in the form of georeferenced images (tiles). To load TMS data into QGIS, install and activate the TileMapScale plugin, as described in Chapter 1, Handling Your Data. After installation, the plugin is available from the TileMapScale menu under Plugins. The plugin's panel consists of two tabs. On the first tab, Tool, you can see a drop-down list with the available TMS datasets. With the activate zoomlevels toggle, scales will be set automatically to fit the tile's zoom level. Under the Options tab, you can activate Use 'On-The-Fly' Transformation if you want the tile layers to be adjusted to map projection. Set min/max Zoomlevels and click on the DPI button to set the resolution directly.
Note
The plugin stores dataset descriptions in the UserName\ .qgis2\ python\ plugins\ TileMapScaleLevels\ datasets
folder as .xml
files. These files use the GDAL TMS minidriver format to describe the data source parameters. You can read more about this at http://www.gdal.org/frmt_wms.html. Using the examples provided with the original plugin installation and by studying the documentation, you can create .xml
files for your own data providers.
Other than this plugin, you can also use the TileLayer and QuickMapServices plugins to work with TMS.