Book Image

Mastering Geospatial Development with QGIS 3.x - Third Edition

By : Shammunul Islam, Simon Miles, Kurt Menke, GISP, Richard Smith Jr., GISP, Luigi Pirelli, John Van Hoesen, GISP
Book Image

Mastering Geospatial Development with QGIS 3.x - Third Edition

By: Shammunul Islam, Simon Miles, Kurt Menke, GISP, Richard Smith Jr., GISP, Luigi Pirelli, John Van Hoesen, GISP

Overview of this book

QGIS is an open source solution to GIS and widely used by GIS professionals all over the world. It is the leading alternative to proprietary GIS software. Although QGIS is described as intuitive, it is also, by default, complex. Knowing which tools to use and how to apply them is essential to producing valuable deliverables on time. Starting with a refresher on the QGIS basics and getting you acquainted with the latest QGIS 3.6 updates, this book will take you all the way through to teaching you how to create a spatial database and a GeoPackage. Next, you will learn how to style raster and vector data by choosing and managing different colors. The book will then focus on processing raster and vector data. You will be then taught advanced applications, such as creating and editing vector data. Along with that, you will also learn about the newly updated Processing Toolbox, which will help you develop the advanced data visualizations. The book will then explain to you the graphic modeler, how to create QGIS plugins with PyQGIS, and how to integrate Python analysis scripts with QGIS. By the end of the book, you will understand how to work with all aspects of QGIS and will be ready to use it for any type of GIS work.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Adding functionality with plugins


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.

Note

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 Plugins | 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 Plugins, Vector, Raster, Database, Web, or Processing. The following information box describes a great plugin for adding base maps.

Note

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 Web | QuickMapServices | 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.

Custom QGIS variables

A new feature of QGIS since version 2.12 is custom variables. Variables can be set at several different scopes or levels:

  • Global
  • Project
  • Layer

Global variables are available at the application level in any QGIS Desktop instance. These can be managed from Settings | Options | 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 Project level.

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.