Book Image

Learn QGIS - Fourth Edition

By : Andrew Cutts, Anita Graser
Book Image

Learn QGIS - Fourth Edition

By: Andrew Cutts, Anita Graser

Overview of this book

QGIS 3.4 is the first LTR (long term release) of QGIS version 3. This is a giant leap forward for the project with tons of new features and impactful changes. Learn QGIS is fully updated for QGIS 3.4, covering its processing engine update, Python 3 de-facto coding environment, and the GeoPackage format. This book will help you get started on your QGIS journey, guiding you to develop your own processing pathway. You will explore the user interface, loading your data, editing, and then creating data. QGIS often surprises new users with its mapping capabilities; you will discover how easily you can style and create your first map. But that’s not all! In the final part of the book, you’ll learn about spatial analysis and the powerful tools in QGIS, and conclude by looking at Python processing options. By the end of the book, you will have become proficient in geospatial analysis using QGIS and Python.
Table of Contents (8 chapters)

Installing QGIS 3.4

QGIS runs on all operating systems; it is even possible to install it on a Raspberry Pi. The QGIS project provides ready-to-use packages as well as instructions to build from source code at Here, we will cover how to install QGIS on two systems: Windows and Ubuntu.

Full installation instructions for every supported operating system are available at

Like many other open source projects, QGIS offers you a choice between different releases. For the tutorials in this book, we will use the QGIS 3.4 long term release (LTR) version. We recommend installing this version in order to follow this book with ease. As you build familiarity and confidence, you may wish to work with different versions. The core QGIS functionality generally remains the same. Newer versions will include the latest release (LR), which is normally updated every four months, or the developer version (DEV) for which you can get nightly builds, if needed. While exciting, the DEV version should not be relied on for anything other than testing or inspecting new features.

You can find more information about the releases as well as the schedule for future releases at
For an overview of the changes between releases, check out the visual change logs at

Installing QGIS on Windows

On Windows, we have two different options for installing QGIS. These are the OSGeo4W and the standalone installer.

The OSGeo4W installer is a small, flexible installation tool that makes it possible to download and install QGIS and many more OSGeo tools with all their dependencies. The main advantage of this installer over the standalone installer is that it makes updating QGIS and its dependencies very easy. I recommend that you use OSGeo4W where practical. You can download the 32-bit and/or the 64-bit OSGeo4W installers from . You can download directly from for the 32-bit version. If you have a 64-bit version of Windows, you can also download from Download the version that matches your operating system and keep it. In the future, whenever you want to change or update your system, just run it again.

If you prefer, you can use the standalone installer. This is one file to download (approximately 400 MB in size). It contains a QGIS release, the Geographic Resources Analysis Support System (GRASS) GIS, and the System for Automated Geoscientific Analyses (SAGA) GIS in one package. For a beginning, this is the easiest installation option.

Installing QGIS using the OSGeo4W installer

In this section, we will focus on installing QGIS using the OSGeo4W installer. This is a convenient way to install QGIS and a host of other open source GIS tools.

QGIS 3.4 will, in February 2019, become the first LTR of QGIS 3 replacing 2.18.

Latest QGIS release

Start by double-clicking on OSGeo4W executable. This will lead you to the following screenshot:

OSGeo4W setup screen

Select the Express Desktop Install radio button. This may not install QGIS 3.4. If you wish to specify a version, please see the next section on Advanced Installers. The Advanced Install radio button is useful if you want to customize your installation, or choose your installation version or perhaps by install the development version of QGIS:

Setting the express package selection

Accept the defaults and click on the Next button. This will set off the download process. Progress will be displayed as each component is downloaded. Having these installed will provide you with more tools to perform Geospatial analysis. After a short period of time, you should see OSGeo4W in your programs menu along with all the other installed software, similar to the following screenshot:

How QGIS appears in Windows

If QGIS is appearing in your programs menu, then it is now installed on your machine.

It is possible to have multiple versions of QGIS installed on Windows. This may mean that you could have QGIS 2 and QGIS 3 running on the same machine. Please remember QGIS 3 projects will not open in QGIS 2. You may need to have two versions installed if you are reliant on a plugin that is no longer supported or has as yet to be ported to QGIS 3.

Advanced installer (to specify version)

Select the radio button next to Advanced Install, as shown in the following screenshot:

Advanced installer

Step through the installation wizard. When you get to the Select Packages, choose the version you require. In the following screenshot I have selected the 3.4.0-1 release:

Installing QGIS 3.4 via advanced install

You can select other packages if required. Once you have chosen the software, click on the Next button. Step through the wizard by accepting the defaults and the installation will begin.

Installing on Ubuntu

On Ubuntu, the QGIS project provides packages for the LTR, LR, and DEV versions. For this book, we recommend installing the LTR version of 3.4 if available (release date: February 2019).

To avoid conflicts that may occur due to incompatible packages, make sure that you only add one of the following package source options. The specific lines that you have to add to the source list depend on your Ubuntu version. The following version is latest release for Debian stretch:

deb stretch main
deb-src stretch main

After choosing the repository, we will add the repository's public key to our apt keyring. This will avoid the warnings that you might otherwise get when installing from a non-default repository. Run the following command in the terminal:

wget -O - | gpg --import
gpg --fingerprint CAEB3DC3BDF7FB45
gpg --export --armor CAEB3DC3BDF7FB45 | sudo apt-key add -
You might need to make adjustments based on your system. For an updated list of supported Ubuntu versions, check out By the time this book goes to print, the key information might have changed. Refer to for the latest updates.

Finally, to install QGIS, run the following commands. The first will fetch any updates to packages on your system, and the second will install QGIS, the python library, and the grass plugins:

sudo apt-get update
sudo apt-get install qgis python-qgis qgis-plugin-grass