In this chapter, we will review the basic functionality of QGIS and explore some of the new features of versions starting from 3.4. If you need a refresher on QGIS or a quickstart guide to QGIS, you should read this chapter. The topics we will cover in this chapter are as follows:
QGIS is a volunteer-led development project licensed under the GNU General Public License, and was started by Gary Sherman in 2002. The project was incubated with the Open Source Geospatial Foundation (OSGeo) in 2007, with QGIS 1.0 being released in 2009. The continued development of QGIS is supported by an active and vibrant community from around the world. Many people assume that they can only help with the development of QGIS if they can perform computer programming, but this is false! QGIS has many community members that write documentation, test the program for bugs, translate documents, answer forum questions, and provide financial support. QGIS user groups exist as well, aiming to bring people together to share experiences of QGIS. It is easy to get involved, and the authors encourage you to consider contributing. Learn about how to get involved at http://qgis.org/en/site/getinvolved/.
Currently, a new version of QGIS is released around every four months. The version released each spring is designated as a long-term release (LTR). This means it will be supported for one calendar year. Each quarter, a new stable version is released and bug fixes applied to the LTR. The LTR is recommended for production environments since it has a slower release cycle. At the time of writing, QGIS 3.4.5 is the current LTR, with version 3.6 available for download.
QGIS can be installed on Windows, macOS, Unix, Linux, and Android operating systems, making it a very flexible software package. Both the binary installers and source code can be downloaded from download.qgis.org. In this section, we will briefly cover how to install QGIS on Windows, macOS, and Ubuntu Linux. For the most up-to-date installation instructions, refer to the QGIS website.
On the QGIS website, download the correct version of QGIS for your Windows machine. Downloadable executable files come in 32-bit and 64-bit flavors. We recommend downloading the latest release as advertised on the QGIS website download page.
For Windows, there are two installation options, which are as follows:
- QGIS Standalone Installer: The standalone installer installs the binary version of QGIS and the Geographic Resource Analysis Support System (GRASS) using a standard Windows installation tool. You should choose this option if you want an easy installation experience of QGIS. This is also the ideal installation method for organizations or businesses wishing to deploy QGIS to multiple users.
If you are unsure on how to install QGIS, the QGIS website contains details on how to do this.
The QGIS website provides download mac installer packages for macOS, that contain readme files for the installation of QGIS. Documentation and support for QGIS on macOS has greatly improved, and while it is beyond the scope of this chapter to detail the install process and document any possible issues that might incur during installation, the GIS Stack Exchange (https://gis.stackexchange.com/) is a great refresh resource.
There are two options when installing QGIS on Ubuntu: installing QGIS only, or installing QGIS as well as other Free and Open Source Software for Geographical Information Systems (FOSSGIS) packages. Either of these methods requires the use of the command line,
sudo rights, and the
apt-get package manager.
Depending on whether you want to install a stable release or an experimental release, you will need to add the appropriate repository to the
sudo access, edit
/etc/apt/sources.list and add the following line to install the current stable release or the current release source code, respectively:
deb http://qgis.org/debian trusty main deb-src http://qgis.org.debian trusty main
Depending on the release version of Ubuntu you are using, you will need to specify the release name as
precise. For the latest list of QGIS releases for Ubuntu versions, visit download.qgis.org.
With the appropriate repository added, you can proceed with the QGIS installation by running the following commands:
sudo apt-get update sudo apt-get install qgis python-qgis
To install the GRASS plugin (recommended), install the optional package by running this command:
sudo apt-get install qgis-plugin-grass
ubuntugis project installs QGIS and other FOSSGIS packages, such as GRASS on Ubuntu. To install the
ubuntugis package, remove the
http://qgis.org/debian lines from the
/etc/apt/sources.list file and run the following commands:
sudo apt-get install python-software-properties sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt-get update sudo apt-get install qgis python-qgis qgis-plugin-grass
At the time of writing, there is really only one Android QGIS application available on Google Play, called QField, developed by OPENGIS.ch from Switzerland. Users of QGIS can save their projects to their Android device and then reopen them in QField. The application comes with Geolocation capabilities, data editing, and photos captured, to name just a few of its features.
Further information on QField can be found at http://www.qfield.org/docs/index.html.
While QField may currently (at the time of writing) be one of the main Android QGIS applications available, the underlying architecture of QGIS, namely QT5 and Python3, mean that development and deployment of user-created Android applications is not far away, thanks to crowdfunding opportunities organized by such companies as Lutra Consultancy and North Road.
It is possible to install the Ubuntu Linux operating system on a Chromebook via Crouton (https://chromebook.guide/crouton/). This essentially creates a dual boot environment allowing you to switch between the Chrome OS and Ubuntu very quickly with some keyboard strokes. Once Crouton is set up, QGIS can be installed via the preceding Ubuntu QGIS install processes.
While Chromebooks are relatively cheap, they are weak, if not lacking, in hardware such as graphic cards. Therefore, while it is possible to install QGIS on a Chromebook, we would suggest that doing so is for hobbyists looking to explore/test the capabilities of this union and that it would not be suitable for production environments.
Using the RollApp website (https://www.rollapp.com), you can access QGIS, plus a range of other open source software in your web browser. This means that for Chromebook and iPad (for example), users can access QGIS without physically installing any software or making system configuration changes. RollApp is designed around using cloud base storage, such as Google Drive, Dropbox, and Box. This makes sharing data and projects very easy.
With the release of version 3 of QGIS comes a host of new features and tools—far too many to document here, but if you are interested, take a look at http://changelog.qgis.org/en/qgis/version/3.4-LTR. For the new addition to QGIS 3.6, have a look at this http://changelog.qgis.org/en/qgis/version/3.6.0/. The biggest shift in QGIS 3.x is the migration from Python 2 to 3, which has extended the functionality to run scripts, processes, and tasks. Further to this, the underlying application used to build the QGIS interface, called Qt as of version 3.x, runs off Qt5.
To highlight perhaps just a few of these new features, note the following:
- Data Source Manager: The Data Source Manager (accessed via or Ctrl + L) is perhaps the most notable visual change of 3.4, as it is presented as the default tool to accessing data to load onto theMap Canvas:
- Opening layers over HTTP(s), FTP, and cloud storage: Sharing and accessing data through QGIS has gotten a whole lot easier with 3.x series. No longer does data need to be stored on a local or networked drive; instead, data can be accessed through HTTP(s), FTP, or via cloud storage providers such as Google Drive. There are now really no limits as to how QGIS can fetch, receive, and display GIS data.
- Filters: In previous versions of QGIS, it has been difficult to know which layers have had filters applied to them. In version 3.4, this has been remedied with a filter icon being placed on all layers that have filters applied. A user can click on the filter icon to gain quick access to the query builder.
- Import geotagged photos: Photos that have been geotagged (which is commonly set as a default function on most modern smartphones) can now be uploaded onto the Map Canvas and represented as a point value. The metadata associated with the photo can also be accessed.
- Save project to Postgres: This is a truly remarkable step forward for QGIS. The ability to save a QGIS project to a database table adds a new level of security, but also accessibility, to QGIS. It is now possible to simply send someone postgres connection details and, once added into QGIS, this will allow the user to access permission-based projects and layers (tables) stored on the database. This means that no data, no projects, and indeed, no physical files need to be handled by a user to access QGIS data.
- Locator Search Bar: Located in the bottom left, below the panels, is the Locator Search bar that is a quick finder for processes, tools, and can even be configured to search layers.
- 3D and mesh: There has been significant investment in 3D in version 3. 3D views of data can now be seen in its own Map View, which runs in parallel to the main Map Canvas. Mesh data can now be loaded into QGIS and viewed in 3D.
- Print Layouts: Other than a change of name from Print Compose to Print Layouts, QGIS 3.4 brings some new elements to the Print window, such as the ability to add 3D views. There have been changes to the Item Properties to increase overall functionality.
- Identity tool for mesh layers: In QGIS 3.6, we can use Identify tool with mesh layer. We can see the value of both scalar and vector component
To have a look at the features of QGIS 3.6, please visit this link: https://qgis.org/en/site/forusers/visualchangelog36/index.html. For a look at the new editions in QGIS 3.4, please refer to this link: https://qgis.org/en/site/forusers/visualchangelog34/. If you visit any of these pages, you will find link for new features for all the versions of QGIS.
QGIS is composed of two programs: QGIS Desktop and QGIS Browser. Desktop is used for managing, displaying, analyzing, and styling data. Browser is used for managing and previewing data. This section will give you a brief tour of the graphical user interface components of both QGIS Desktop and QGIS Browser.
The QGIS interface is divided into four interface types:
Map Canvas. The following screenshot shows QGIS Desktop with all four interface types displayed:
The Map Canvas shows the styled data added to the QGIS project. The Menu Bar, displayed across the top, provides access to most of the QGIS functions. The Toolbars provide quick access to QGIS core functionality. The Toolbars can be arranged to either float independently or dock at the top, bottom, left, or right sides of the application—equally, toolbar ideas can be removed from the screen via Settings | Interface Customization.
If you are going to use the Interface Customization tool to remove icons, make a backup file first of the current UI (User Interface) of QGIS. When the Enable Customization button is checked, click on the Save button and save the
.ini file to a safe place. Then, make your changes but remove icons and so on. If you ever what QGIS looking as it did, prior to the removal of icons that you made, use the Loadfrom file option to reinstall the original backup
.ini file that you created.
Note that if you change the UI via the Interface Customization tool, then you'll need to close QGSIS before you see the changes take effect.
The panels, such as
Layers, provide a variety of functionality and can be arranged to either float independently or dock above, below, right, or left of the map display or side by side as tabs.
QGIS Desktop offers a number of customization options. You can toggle the visibility of toolbars by navigating to
Toolbars, or by right-clicking on the
Menu Bar and then enabling the
Toolbars button, which will open a context menu allowing you to toggle the toolbar and panel visibility. You can assign shortcut keys to operations by navigating to
Configure shortcuts. You can also change application options, such as interface language and rendering options, by navigating to
One strength of QGIS is its ability to load a large number of data types. In this section, we will cover loading various types of data into QGIS Desktop.
In general, data can be loaded in a number of ways. The main way, which will be covered in detail in this section, is to use the Data Source Manager.
Alternatively, using the
Browser panel, navigate to the data you wish to load, and then either drag the data onto the Map Canvas or right-mouse click on it and choose Add Selected Layer(s) to canvas.
Under Settings | Add Layer from the main Menu.
Also, you can drag and drop data/files from your native operating systems file manager. Even ZIP files that contain
.shp files can be added to the Map Canvas in this way.
To load vector files using the Data Source Manager, click on the Open Data Source Managericon
, or press Ctrl + L. From the list of layer types on the left, choose Vector. You now have the option to load a Vector file for a number of Source type options:
The source type contains four options:
Protocol: HTTP(S), cloud, etc. When you choose a source type, the source interface will change to display the appropriate options. Let's take a moment to discuss what types of data these four source types can load:
There is a big push to move users away from using ESRI shapefiles, replacing it instead with GeoPackages (more will be discussed about these later). QGIS, in the first instance, will prompt you to save to this format over
File: This can load flat files that are stored on disk. The commonly used flat file types are as follows:
- GeoPackage (
- ESRI shapefile (
- GeoJSON (
- Geography Markup Language (
- AutoCAD DXF (
- Comma-separated values (
- GPS eXchange Format (
- Keyhole Markup Language (
- SQLite/SpatiaLite (
- GeoPackage (
Directory: This can load data stored on disk that is encased in a directory. The commonly used directory types are as follows:
- U.S. Census TIGER/Line
- Arc/Info Binary Coverage
- Database: This can load databases that are stored on disk or those available through service connections. The commonly used database types are as follows:
- ESRI Personal GeoDatabase
Protocol: This can load protocols that are available at a specific URL. In QGIS 3.4, these protocols have been extended to include calls to HTTP/HTTPS/FTP, AWS S3, and Google Cloud Storage, adding to the previous GeoJSON and CouchDB options:
To load raster files using the Data Source Manager, click on the Open Data Source Manager icon
, or press Ctrl + L. From the list of layer types on the left, choose Raster.
You now have the option to load a raster file for File or Protocol: HTTP(S), cloud, etc. (much like Vector):
The commonly used raster types supported by GDAL are as follows:
The Geospatial Data Abstraction Library (GDAL) is a free and open source library that translates and processes vector and raster geospatial data formats. QGIS, as well as many other programs, uses GDAL to handle many geospatial data processing tasks. You may see references to OGR or GDAL/OGR as you work with QGIS and GDAL. OGR Simple Features Library references the vector processing parts of GDAL. OGR is not really a standalone project, as it is part of the GDAL code now; however, for historical reasons, OGR is still used. More information about GDAL and OGR can be found at http://gdal.org. GDAL is an OSGeo (http://osgeo.org) project.
QGIS supports PostGIS, SpatiaLite, Microsoft SQL Server, and Oracle databases. Regardless of the type of database you wish to load, the loading sequence is very similar. Therefore, instead of covering specific examples, the general sequence will be covered.
To create a new database connection using the Data Source Manager, perform the following:
- Click on the OpenData Source Manager icon or press Ctrl + L
- On the left, choose the database you want to connect to, and, in the connection window, click on the New button
- Add all the connection details required
To add a layer once a connection has been established, perform the following:
- Click on the Open Data Source Manager icon
- Click on Connect
When connected successfully, you will be presented with a list of layers that can be added to the Map Canvas. An alternative and perhaps better method for loading data on the Map Canvas is to use the Browser panel once you have created the new database connection. Using the Browser panel gives the user a cleaner overview of the layers and tables that can be added to the Map Canvas.
QGIS supports the loading of OGC-compliant web services such as WMS/WMTS, WCS, and WFS. Loading a web service is similar to loading a database service in that you must first set up the connection to the service, and then connect to the service to choose which layers to add to the Map Canvas.
As an example, to add a WMS service, click on the Open Data Source Manager icon
or press Ctrl + L, and, on the left-hand side of the window, click on WMS/WMTS.
Click on the New button and give the new connection details a name (this is a free text friend, so the name can be anything you wish) and then add in the URL of the WMS/WMTS. Once completed, click on OK.
As with viewing data from databases in the previous section, to view the data available via the connection that you have established via the Data Source Manager, it is best to access the data via the browser panel.
When working with spatial data, it is important that a CRS is assigned to the data and the QGIS project. To view the CRS for the QGIS project, click on
Project, and choose the
It is recommended that all data added to a QGIS project be projected into the same CRS as the QGIS project. However, if this is not possible or convenient, QGIS can project layers on the fly to the project's CRS.
If you want to quickly search for a CRS, you can enter the EPSG code to quickly filter through the CRS list. An EPSG code refers to a specific CRS stored in the EPSG Geodetic Parameter Dataset online registry that contains numerous global, regional, and local CRSs. An example of a commonly used EPSG code is
4326, which refers to WGS 84. The EPSG online registry is available at http://www.epsg-registry.org/.
To view the CRS for a layer, perform the following steps:
- Open the layer's properties by either navigating to
Properties, or by right-clicking on the layer in the
Sourcefrom the context menu
- If the layer's CRS is not set or is incorrect, click on the globe at the end of the drop-down menu, and select the correct CRS
There are two types of tables you can work with in QGIS: attribute tables and standalone tables. Whether they are from a database or associated with a shapefile or a flat file, they are all treated the same. Standalone tables can be added by clicking on Layer | Add Layer |
Add Vector Layer.
QGIS supports the table formats supported by OGR along with database tables. Tables are treated like any other GIS layer; they simply have no geometry. Both types of tables can be opened within Desktop by selecting the layer/table in the
Layers panel, and then by either clicking on
Open Attribute Table under
Layer, or by right-clicking on the data layer, and choosing
Open Attribute Table from the context menu. They can also be previewed in QGIS Browser by choosing the
The table opens in a new window that displays the number of table rows and selected records in the title bar. Beneath the title bar is a series of buttons that allow you to toggle between editing, managing selections, and adding and deleting columns. Most of the window is filled with the table body. The table can be sorted by clicking on the column names. An arrow will appear in the column header, indicating either an ascending or a descending sort. Rows can be selected by clicking on the row number on the left-hand side. In the lower-left corner is a
Tables menu, which allows you to manage what portions of the table should be displayed. You can choose
Show All Features (default setting),
Show Selected Features,
Show Features Visible on Map (only available when you view an attribute table),
Show Edited and New Features, create column filters, and advanced filters (expression). The lower-right corner has a toggle between the default table view and a forms view of the table.
An attribute table is shown in the following screenshot, with parts of the table window identified:
Attribute tables are associated with the features of a GIS layer. Typically, one record in the attribute table corresponds to one feature in the GIS layer. Standalone tables are not associated with GIS data layers. However, they may have data of a spatial nature from which a spatial data layer can be generated (for more information, see Chapter 6, Advanced Data Creation and Editing). They may also contain data that you wish to join to an existing attribute table with a table join, which we will cover in the next section.
Let's say that you need to make a map of the total population by county. However, the counties' GIS layers do not have population as an attribute. Instead, this data is contained in an Excel spreadsheet. It is possible to join additional tabular data to an existing attribute table.
There are two requirements, which are as follows:
- The two tables need to share fields with attributes to match for joining
- There needs to be a cardinality of one-to-one or many-to-one between the attribute table and the standalone table
To create a join, load both the GIS layer and the standalone table into QGIS Desktop. QGIS will accept a variety of standalone table file formats including Excel spreadsheets (
.xlsx), dBase (
.dbf) files, and comma-separated value (
.csv) files. You can load this tabular data using Layer | Add Layer |
Add Vector Layer and setting the file type filter to
All files (*) (*.*) as shown in the following screenshot:
Once the data is loaded, a join can be completed by following these steps:
- Select the GIS layer in the
Layerspanel that will receive the new data from the join.
- Navigate to
Propertiesand choose the
- Click on the Add join button (the one with a green plus sign).
- Choose the
Join field, and
Target fieldvalues. The
Join fieldvalues represent the standalone table. The
Target fieldvalue is the column in the attribute table on which the join will be based.
Although, in this example, the join field and the target field have the same name, this is not a requirement. The two fields merely need to hold the same unique ID.
- At this point, you can choose
Cache join layer in virtual memory,
Create attribute index on join field, or
Choose which fields are joined. The last option allows you to choose which fields from the join layer to append to the attribute table. A new feature also allows you to set a
Custom field name prefix. At this point, the
Add vector joinwindow will look like the following screenshot.
- Once created, the join will be listed on the
Joinstab. The extra attribute columns from the
Join layerwill be appended to the attribute table, where the value in the
Join fieldmatches the value in the
- The additional data from the join can be used to query the data and style the data.
- Joins can be modified by selecting the join and clicking the pencil edit button. They can be removed by clicking on the remove join button (the one with a red minus sign).
Vector data layers can be edited within QGIS Desktop. Editing allows you to add, delete, and modify features in vector datasets. The first step is to put the dataset into edit mode. Select the layer in the
Layers panel and click on
Toggle Editing under
Layer. Alternatively, you can right-click on a layer in the
Layers panel and choose
Toggle Editing from the context menu. Multiple layers can be edited at a time. The layer currently being edited is the one selected in the
Layers panel. Once you are in edit mode, the digitizing toolbar (shown in the following screenshot) can be used to add, delete, and modify features:
From left to right, the tools in the digitizing toolbar are as follows:
Current Editstool allows you to manage your editing session. Here, you can save and roll back edits for one or more selected layers.
Toggle Editingtool provides an additional means to begin or end an editing session for a selected layer.
Save Layer Editstool allows you to save edits for the selected layer(s) during an editing session.
Add Featurestool will change to the appropriate geometry depending on whether a point, line, or polygon layer is selected. Points and vertices of lines and polygons are created by clicking on the Map Canvas. To complete a line or polygon feature, right-click. After adding a feature, you will be prompted to enter the attributes.
Vertex Toollets you move individual feature vertices. Click on a feature once with the tool to select it, and the vertices will change into red boxes. Click again on an individual vertex to select it. The selected vertex will turn into a dark-blue box. Now, the vertex can be moved to the desired location. Additionally, edges between vertices can be selected and moved. To add vertices to a feature, simply double-click on the edge where you want the vertex to be added. Selected vertices can be deleted by pressing the Delete key on the keyboard.
- Modify the attributes of all selected features simultaneously, which allows you to set a value for all the selected features:
- Features can be deleted, cut, copied, and pasted using the
Copy Features, and
As of version 3 of QGIS, how snapping is carried out has changed. Snapping is a specified distance (tolerance) within which vertices of one feature will automatically align with vertices of another feature. Once enabled, users can set which layers are to be used to snap against; if vertex, vertex and segments, or just segments, are to be snapped against; and the distance from which snapping will occur. Additional topological and tracing functions have been added to further enhance the snapping toolset:
When you load spatial data layers into QGIS Desktop, they are styled with a random single symbol rendering. To change this, right-mouse click on the layer and choose properties, and, in the context menu, click on
There are several rendering choices available from the menu in the top-left corner, which are as follows:
Single Symbol: This is the default rendering in which one symbol is applied to all the features in a layer.
Categorized: This allows you to choose a categorical attribute field to style the layer. Choose the field and click on
Classifyand QGIS will apply a different symbol to each unique value in the field. You can also use the
Set column expressionbutton to enhance the styling with a SQL expression.
Graduated: This allows you to classify the data by a numeric field attribute into discrete categories. You can specify the parameters of the classification (classification type and number of classes) and use the
Set column expressionbutton to enhance the styling with a SQL expression.
Rule-based: This is used to create custom, rule-based styling. Rules will be based on SQL expressions.
Point Displacement: If you have a point layer with stacked points, this option can be used to displace the points so that they are all visible.
- Point Cluster: This option groups clusters of points together at a specified distance. This will be covered more in later chapters.
Inverted Polygons: This is a new renderer that allows a feature polygon to be converted into a mask. For example, a city boundary polygon that is used with this renderer would become a mask around the city. It also allows the use of
Rule-basedrenderers and SQL expressions.
Heatmap: This allows you to create a heat map rendering of point data based on an attribute.
2.5D: This allows you to extrude data into a 2.5D space. A common use case is to extrude building footprints upward, creating an almost 3D rendering.
The following screenshot shows the symbology properties available for a vector line layer:
For a given symbol, you can work with the first level, which gives you the ability to change the transparency and color. You can also click on the second level, which gives you control over parameters such as fill, border, fill style, border style, join style, border width, and X/Y offsets. These parameters change depending on the geometry of your layer. You can also use this hierarchy to build symbol layers, which are styles built from several symbols that are combined vertically.
You also have many choices when styling raster data in QGIS Desktop. There is a different choice of renderers for raster datasets, which are as follows:
Multiband color: This is for rasters with multiple bands. It allows you to choose the band combination that you prefer.
Paletted / Unique values: This is for singleband rasters with an included color table. It is likely that it will be chosen by QGIS automatically, if this is the case.
Singleband gray: This allows a singleband raster or a single band of a multiband raster to be styled with either a black-to-white or white-to-black color ramp. You can control contrast enhancement and how minimum and maximum values are determined.
Singleband pseudocolor: This allows a singleband raster to be styled with a variety of color ramps and classification schemes.
- Hillshade: Used mainly against Digital Terrain Data, this function allows to you add hillshade relief to the layer by changing the angles/direction of sunlight.
The following is a screenshot of the Symbology tab of a raster file's
Layer Properties, showing where the aforementioned style choices are located:
The blending modes allow for more sophisticated rendering between GIS layers. Historically, these tools have only been available in graphics programs and they are a fairly new addition to QGIS. Previously, only layer transparency could be controlled. There are now 13 different blending modes that are available: Normal, Lighten, Screen, Dodge, Addition, Darken, Multiply, Burn, Overlay, Soft light, Hard light, Difference, and Subtract. These are much more powerful than simple layer transparency, which can be effective, but which typically results in the underneath layer being washed out or dulled. With blending modes, you can create effects where the full intensity of the underlying layer is still visible. Blending mode settings can be found in the Symbology menu under
Layer Properties in the
Layer Rendering section (for vectors) and
Color rendering section (for rasters).
With QGIS, you can create maps that can be printed or exported to image and graphic files. Prior to version 3, in order to create maps, you used the Print Composer; this has now changed its name to Layouts. To create a new Layout, click on Project | New Print Layouts. Give the new layout a name, click on
OK, and the composer window will open. From this point on, you can access the new layout from Project | Layouts.
The composer presents you with a blank sheet of paper upon which you can craft your map. Along the left-hand side, there are a series of tools on the
Composer Items toolbar. The lower portion of the toolbar contains buttons for adding map elements to your map. These include the map body, images, text, a legend, a scale bar, graphic shapes, arrows, attribute tables, and HTML frames. Map elements become graphics on the composition canvas. By selecting a map element, graphic handles will appear around the perimeter. These can be used to move and resize the element. The upper portion of the
Composer Items toolbar contains tools for panning the map data, moving other graphic content, and zooming and panning on the map composition.
The majority of the map customization options can be found in the composer tabs. To specify the sheet size and orientation, use the
Composition tab. Once map elements have been added to the map, they can be customized with the
Item properties tab. The options available on the
Item properties tab change according to the type of map element that is selected. The
Atlas generation tab allows you to generate a map book. For example, a municipality could generate an atlas by using a map sheet GIS layer and specifying which attribute column contains the map sheet number for each polygon. The
Items tab allows you to toggle individual map elements on and off.
The toolbars across the top contain tools for aligning graphics (the
Composer Items actions toolbar), navigating around the map composition (the
Paper Navigation toolbar), and tools for managing, saving, and exporting compositions. Maps can be exported as images, PDFs, and SVG graphic files. To export the map, click on the
Composer menu and select one from among
Export as image...,
Export as SVG..., or
Export as PDF... depending on your requirements. The following is a screenshot showing the Layout window:
There are so many potential workflows, analysis settings, and datasets within the broad field of GIS that no out-of-the-box software could contain the tools for every scenario. Fortunately, QGIS has been developed with a plugin architecture. Plugins are add-ons to QGIS that provide additional functionality. Some are written by the core QGIS development team, and others are written by QGIS users.
You can also browse the QGIS Python Plugins Repository at https://plugins.qgis.org/plugins/.
You can explore the QGIS plugin ecosystem by navigating to
Manage and Install Plugins. This opens the
Plugins Manager window (shown in the following screenshot), which will allow you to browse all plugins, those that are installed, those that are not installed, plugins that are newly available, and adjust the plugin manager settings. If there are installed plugins with available upgrades, there will also be an
Upgradable option. The search bar can be used to enter search terms and find available plugins related to the topic. This is the first place to look if there's a tool or extra type of functionality that you need! To install a plugin, simply select it and click on the
Install Plugin button. Installed plugins can be toggled on and off by checking the box next to each:
You will be notified by a link at the bottom of the QGIS Desktop application if there are updates available for your installed plugins. Clicking on the link will open the
Plugins Manager window, where the
Upgrades tab will allow you to install all or some of the available updates. Plugins themselves may show up as individual buttons, toolbars, or as items under the appropriate menu, such as
Processing. The following information box describes a great plugin for adding base maps.
To add a basemap to QGIS, enable the
Quick Map Services plugin. Once it's installed, it appears as an item on the
Web menu. You can configure it to include more map services. From the menu bar, choose
Settings. Click on the
Contributed Services tab, and click the
Get contributed pack button. At this point, it will allow you to add base maps from OpenStreetMap, Google Maps, Bing Maps, Map Quest, OSM/Stamen, Apple Maps, and several more. This plugin requires an internet connection.
A new feature of QGIS since version 2.12 is custom variables. Variables can be set at several different scopes or levels:
Global variables are available at the application level in any QGIS Desktop instance. These can be managed from
Variables. Examples of what you might set as global might be a company/organization name that you can then later use in expressions, Print Layouts, or when editing data to autopopulate fields.
Project variables are available throughout a given project. These can be set from the
Project Properties window on the
Variables tab. Examples may include project names, reference numbers, or client names.
Layer level variables are available from
Layer Properties on the
Variables tab, and are available only for that layer.
In each instance, variables can be added using the green plus button found in the bottom-right corner of the variables screens.
The other important aspect of these variables is that they cascade from most specific scope to least specific scope. In other words,
@my_var set at the
Global level will be overwritten by
@my_var set at the
Variables are still a very new feature, but have a lot of potential for creating more efficient workflows.Once you begin using them, you will undoubtedly discover many other use cases.
This chapter provided a refresher on the basics of QGIS and a look at some of the new functionality of 3.x. We covered how to install the software on several platforms. We then covered how to load vector, raster, and database data layers. Next, you were shown how to work with coordinate reference systems and style data. We covered the basics of working with tables, including how to perform a table join. The chapter concluded with a refresher on composing maps, how to find, install, and manage plugins, and a primer on QGIS custom variables.
The next chapter will cover styling vectors and raster data. Now that you have had a refresher on the basics of QGIS, it is time to learn how to expand your work to include spatial databases. In Chapter 3, Creating Spatial Databases, you will learn how to create and manage spatial databases within QGIS.