Author: Ben Hur
This module serves as an introduction to QGIS. At the end of this module, learners should be familiar with:
They should also learn:
The module will also discuss some nuances of QGIS and what makes it unique or different from other GIS such as QGIS file formats.
The required tools and resources for this module are:
The map below (https://flic.kr/p/2jFfGJP) shows parts of the City of Bogota in Columbia made in the style of Vincent van Gogh’s “Starry Starry Night” by Andrés Felipe Lancheros Sánchez.
This next map (https://flic.kr/p/2jAsphv) shows storm trace data from NOAA between 1851 to 2020 made by Fajr Alim.
This next one (https://flic.kr/p/FA9TiR) is a map of Kerguelen Island by Heinrich Lingnau Schneider.
This last one (https://flic.kr/p/2kqVzsg) is of field goal attempts and points scored per attempt during the UAAP Men’s Basketball Tournament Season 81 in the Philippines by Ben Hur Pintor.
What do all these maps have in common? For one, they were all made using QGIS.
The maps shown above were all created in QGIS (https://qgis.org/en/site/), a free and open source Geographic Information System (GIS). QGIS can be used with all kinds of spatial data (such as basketball data in the last example) and not just with earth-related geospatial data.
People are able to create wonderful and amazing maps such as the examples above because QGIS is free, open source, and has powerful data management, analysis, and presentation capabilities.
QGIS, known as Quantum GIS prior to its 2.X release, is a mature, cross-platform, free and open source Geospatial Information System (GIS).
It is an enterprise ready GIS that has features for collecting, storing, analysing, presenting, and managing spatial & non-spatial data. It also integrates well with other existing geospatial technologies and serves as an integral part of any FOSS4G (Free and Open Source Software for Geospatial) stack.
Being cross-platform, QGIS runs on GNU/Linux, macOS, Windows, and even Android.
QGIS releases and development follow a time based schedule/roadmap (https://www.qgis.org/en/site/getinvolved/development/roadmap.html).
A QGIS release is specified by three numbers (X.Y.Z). For example, QGIS 3.16.4.
There are three main branches of QGIS that users can install. These are the Long Term Release (LTR) branch, Latest Release (LR) branch, and the Development (Nightly) branch.
So which version should you use? It depends. If you need a version that is maintained for a longer time and you don’t necessarily need new features as they are released then the LTR version might be for you. If you need to have the most recent features and don’t mind doing an upgrade every few months, the LR version just might be for you. Sometimes it’s also good to take a look at the development or nightly versions especially if you are curious or excited about the upcoming features in QGIS.
For more information, visit: https://bnhr.xyz/2020/10/26/about-qgis-versions-release-cycle-english.html
Figure 1.1. QGIS Map Showcase
For more maps created with QGIS, visit: https://www.flickr.com/groups/2244553@N22/pool/with/50355460063/
QGIS is cross-platform and works on Linux, Windows, and macOS. Being open source, you can build and install QGIS from its source code available at https://github.com/qgis/QGIS/.
Installers and installation instructions are also available at https://qgis.org/en/site/forusers/download.html or https://qgis.org/en/site/forusers/alldownloads.html.
For Linux (or GNU/Linux), QGIS is usually available from your distribution’s package manager. For Debian/Ubuntu users, QGIS has repositories for the LR, LTR, and Development branches as well as versions of QGIS with dependencies from the ubuntugis-unstable PPA. QGIS is also available as a Flatpak package or in Conda.
For Windows, users can choose between the OSGeo4W Network Installer or the Standalone installers. There’s one Standalone installer for the LTR and LR version.
The Standalone installers are the easiest to install and are recommended for beginners. Multiple versions of QGIS can be installed in your computer at once. This means that you can have both the QGIS 3.16 and 3.18 versions installed.
The OSGeo4W Network Installer is a bit more advanced and complex than the standalone installers but it also gives you the ability to update and upgrade your QGIS version in-place which means that you won’t need to uninstall an older version if you want to install a newer one.
In some cases, you would need administrator rights to install QGIS so if you are installing it on a computer where your user does not have administrator rights, you might need to ask your IT or office administrator to install QGIS for you.
The installation in Windows also comes with QGIS with GRASS (another Free and Open Source GIS).
Note that QGIS is slowly removing 32-bit support for Windows so it is best to install QGIS on a computer that runs a 64-bit operating system.
For macOS, there are official All-in-one signed installers for macOS High Sierra (10.13) and newer. QGIS is not yet notarized as required by macOS Catalina (10.15) security rules. On first launch, please right-click on the QGIS app icon, hold down the Option key, then choose Open.
After installing QGIS, you can run or open it as you would any program in your computer. Upon opening QGIS, you will be greeted with the default User Interface (UI) which would look something like below.
Figure 1.2. The QGIS Interface on a fresh install
There are six main parts of the QGIS User Interface – the Menu Bar, Map Canvas, Toolbars, Panels, Status Bar, and the Locator.
At the center of the UI is a Map Canvas. Panels and Toolbars can be positioned around this canvas. Panels can also be docked together to create a multi-tab Panel. There are also other parts of the UI such as the Python Interface, plugin windows, etc.
Menu Bar - the Menu bar is a simple hierarchical menu that provides access to QGIS functions and commands. It is usually located at the top of the UI.
Map Canvas - the Map Canvas is where layers loaded in QGIS are shown. This is also where filters, selects, and symbologies created by the user are reflected. More than one map canvas can be present at any time. A user can zoom, pan, and even rotate the map canvas. A map canvas can also show 3D data.
Toolbars - toolbars show click-and-run buttons. They allow easy access to QGIS commands, features, plugins, etc. They can be moved and docked around the Map Canvas. The list of toolbars can be found, activated, and deactivated from the Menu bar under View ‣ Toolbars. Examples of toolbars are the Attributes Toolbar and the Digitizing Toolbar.
Panels - panels are similar to toolbars but instead of buttons, they provide an interface to more complex functions and features. The Layer Panel and the Browser Panel are examples. Similar to toolbars, they can be moved and docked around the Map Canvas. The list of panels can be found, activated, and deactivated from the Menu bar under View ‣ Panels.
Status Bar - the Status Bar is commonly found at the bottom of the UI and shows relevant information such as the CRS, scale, notifications, etc.
Locator Bar - the Locator bar is found on the bottom left corner of the QGIS interface. It allows the user to easily access layers, fields, processing algorithms, and other things in QGIS. This is one of the most powerful features of QGIS.
Figure 1.3. Parts of the QGIS Interface
One of the beauties of QGIS is the customizability that it provides its users. This customizability starts with the User Interface. By editing some settings and moving some parts of the interface, you can have a QGIS that looks like the one below:
Figure 1.4. The QGIS Interface with some customizations
Resetting the QGIS Interface
To reset your display to the default settings, go to: Settings ‣ Options ‣ System Tab ‣ Settings ‣ Reset button and restart QGIS
The ability to add, create, and extend QGIS’ functionality via plugins is one of its most powerful features.
As of QGIS 3.16.3, there are more than 700 plugins available for the user to download and improve upon. These plugins range in function from the complex to the mundane.
QGIS plugins can be classified as:
Plugins can be installed in three (3) ways:
Figure 1.5. Accessing the Manage and Install Plugins dialog
The Manage and Install Plugins Dialog connects to the QGIS Official Plugin repository (or any repository that you indicate in the Settings Tab) to fetch plugins available for your version of QGIS. It has five (5) tabs:
If the plugin you are looking for is tagged as experimental or deprecated, you need to check Show experimental plugins and Show deprecated plugins from the Settings tab.
The Search Bar allows you to search for plugins found in the plugin repository/ies that you are connected to.
Figure 1.6. The Manage and Install Plugins dialog
Install the following plugins by searching for them in the All tab and clicking Install Plugin in the bottom right corner of the Manage and Install plugins dialog.
QGIS Settings allow you to edit and manage different things about QGIS such as user profiles, styles, coordinate reference systems, keyboard shortcuts, the user interface, default colors, etc. System settings can be found in the Settings **menu and are the default settings used by QGIS unless they are overridden by a Project’s settings. Project Settings can be found in **Project ‣ Properties and pertain to settings or properties for the current project. These values override the system defaults.
Figure 1.7. The System Settings
Figure 1.8. Project Settings
You can change the look-and-feel of QGIS under Settings ‣ Options ‣ General Tab.
You can choose between three themes – default, Blend of Gray, and Night Mapping. You can also change the size of the icons, the font used by QGIS, and other system defaults.
Figure 1.9. General Settings of QGIS
For some settings in QGIS, you might need to restart the application for them to take effect.
QGIS 3.X introduced the concept of QGIS User Profiles.
A User Profile is a collection of settings for plugins installed, toolbars enabled, arrangement of the User Interface, and other settings. QGIS comes with a default User Profile named default. User profiles allow the user to create different settings for specific analyses (e.g. a user profile specific for water resource management, digitizing data, cartography, etc.), particular projects, or even clients.
User Profiles can be created and accessed from the menu bar under: Settings ‣ User Profiles.
The active user profile is shown with [User Profile] in the title bar.
Figure 1.10. Accessing User Profiles
User profiles are saved in a directory on your computer which can be accessed by clicking Settings ‣ User Profiles ‣ Open Active Profile Folder.
A new QGIS window should open with your new user profile. Notice that your profile name is shown in the QGIS title bar.
Do you notice any difference in the new user profile? Check the user interface, plugins, and settings of the old profile and the new profile you created.
QGIS Projects are to QGIS as .mxd files are to ArcMap. These files come either as QGS (.qgs) or QGZ (.qgz). The main difference between the two is that the QGZ format is a compressed (zip) archive containing a QGS file and a QGD file. The QGS format is an XML format for storing QGIS projects. The QGD file is the associated sqlite database of the qgis project that contains auxiliary data for the project. If there are no auxiliary data, the QGD file will be empty.
A QGIS Project File contains everything that is needed for storing a QGIS project, including:
QGIS Project files can be saved in a GeoPackage or a PostGIS database. Saving the project file together with the style file and corresponding layers in a single GeoPackage makes it easy to share QGIS projects.
A QGIS Layer Definition file (QLR) is an XML file that contains a pointer to the layer data source in addition to QGIS style information for the layer. Currently, a QLR file corresponds to a single layer only.
The use case for this file is simple: To have a single file for opening a data source and bringing in all the related style information. QLR files also allow you to mask the underlying datasource in an easy to open file.
An example of QLR usage is for opening a layer from a PostGIS database. Instead of connecting to the database, finding the layer, and applying a filter, you can just open a .qlr file that points to the correct PostGIS layer with its corresponding style and filter.
QML is an XML format for storing layer styling. A QML file (.qml) contains all the information that tells QGIS how to render feature geometries which includes symbol definitions, sizes and rotations, labelling, opacity, blend mode, and more.
A .qml file should have the same name as the data source it corresponds to. When it is found in the same directory or folder as the data source, loading the data source will also automatically load its style as defined in the .qml file.
For example, if you have a GeoJSON named regions.geojson and a QML file named regions.qml, loading regions.geojson in QGIS will apply the styles defined in regions.qml in the loaded layer.
When using GeoPackages (.gpkg), a .qml file is oftentimes not needed since you can save a layer’s style directly in the geopackage.
You can try to create your own QGIS plugin. If there’s no plugin that does what you want then you can always make one yourself.
The Plugin Builder is a plugin that creates a template that can serve as the starting point for QGIS plugin development so you won’t have to create one from scratch. You can install it from the Manage and Install Plugins Dialog.
Of course, you can always create a plugin from scratch. If you are interested in creating your own plugin, you can check the Official QGIS documentation (https://documentation.qgis.org/). For Python plugins, it’s a good idea to check out the PyQGIS Developer Cookbook (https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/).
For more information, see: https://bnhr.xyz/2018/10/08/qgis-plugins-3.0.html
N/A