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

Preface

Welcome to Mastering Geospatial Development with QGIS 3.x, Third Edition. With the release of QGIS 3, QGIS has broken new ground in enhancing the user experience with new features – this book aims to introduce you to these features. Throughout 11 chapters, you will explore QGIS 3.4 and QGIS 3.6, with particular emphasis on data processing, creation, editing, and visualization, with data stored in databases such as Spatialite, GeoPackages, and PostGIS.

Who this book is for

If you are a GIS professional, a consultant, a student, or perhaps a fast learner who wants to go beyond the basics of QGIS, then this book is for you. It will prepare you to realize the full potential of QGIS.

What this book covers

Chapter 1A Refreshing Look at QGIS, covers those features that were new to QGIS in version 3.0 and those that have now been introduced at version 3.4 and version 3.6.

Chapter 2Styling Raster and Vector Data, explores styling raster and vector data for display. First, color selection and color ramp management are covered. Next, single-band and multi-band raster data is styled using custom color ramps and blending modes. Then, complex vector styles and vector layer rendering are covered.

Chapter 3Creating Spatial Databases, introduces the user to the use of databases that are locally stored in file directories, such as Spatialite and GeoPackages. Users will learn how to create their own local database, as well as how to add data into it from scratch, or import existing data. 

Chapter 4Preparing Vector Data for Processing, introduces you to the tools and functions that come as standard within QGIS for working with vector datasets. 

Chapter 5Preparing Raster Data for Processing, introduces you to the tools and functions that come as standard within QGIS for working with rasters.

Chapter 6, Advanced Data Creation and Editing, provides advanced ways to create vector data. As there is a great deal of data in tabular format, this chapter will cover mapping coordinates and addresses from tables. Next, georeferencing of imagery into a target coordinate reference system will be covered. The final portion of the chapter will cover testing topological relationships in vector data and correcting any errors via topological editing.

Chapter 7, Advanced Data Visualization, covers the powerful data visualization tools found only in QGIS.

Chapter 8, The Processing Toolbox, begins with an explanation and exploration of the QGIS Processing Toolbox. Various algorithms and tools, available in the toolbox, will be used to complete common spatial analyses and geoprocessing tasks for both raster and vector formats. To illustrate how these processing tools might be applied to real-world questions, two hypothetical scenarios are illustrated, relying heavily on the GRASS and SAGA tools.

Chapter 9, Automating Workflows with the Graphical Modeler, covers the purpose and use of the graphical modeler to automate analysis workflows. In this chapter, you will develop an automated tool/model that can be added to the Processing Toolbox.

Chapter 10, Creating QGIS Plugins with PyQGIS and Problem Solving, covers the foundational information required to create a Python plugin for QGIS. Information about the API and PyQGIS help will be covered first, followed by an introduction to the iface and QGis classes. Next, the steps required to create and structure a plugin will be covered. The chapter will be wrapped up after providing you with information on creating graphical user interfaces and setting up debugging environments to debug code easily.

Chapter 11, PyQGIS Scripting, covers topics on integrating Python analysis scripts with QGIS outside of the Processing Toolbox. Layer loading and management are first covered, followed by an exploration of the vector data structure. Next, the programmatic launching of other tools and external programs are covered. Lastly, the QGIS map canvas is covered with respect to how a script can interact with the map canvas and layers within.

To get the most out of this book

You should have good knowledge of Python and QGIS. 

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Mastering-Geospatial-Development-with-QGIS-3.x. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Also, you can download data for exercises at https://qgis.org/downloads/data/.

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781788999892_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

SELECT distname as road_name, roadnumber, geom FROM SU_Road WHERE classifica LIKE 'A Road%' AND roadnumber = 'A25'

Any command-line input or output is written as follows:

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

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.