Learning QGIS - Third Edition
By Graser Anita
4/5
()
About this ebook
About This Book
- Learn how to work with various data and create beautiful maps using this easy-to-follow guide.
- Give a touch of professionalism to your maps both for functionality and look and feel with the help of this practical guide.
- A progressive hands-on guide that builds on a geo-spatial data and adds more reactive maps by using geometry tools.
Who This Book Is For
This book is great for users, developers, and consultants who know the basic functions and processes of GIS and want to learn to use QGIS to analyze geospatial data and create rich mapping applications. If you want to take advantage of the wide range of functionalities that QGIS offers, then this is the book for you.
What You Will Learn
- Install QGIS and get familiar with the user interface
- Load vector and raster data from files, databases, and web services
- Create, visualize, and edit spatial data
- Perform geoprocessing tasks and automate them
- Create advanced cartographic outputs
- Design great print maps
- Expand QGIS using Python
In Detail
QGIS is a user-friendly open source geographic information system (GIS) that runs on Linux, Unix, Mac OS X, and Windows. The popularity of open source geographic information systems and QGIS in particular has been growing rapidly over the last few years.
Learning QGIS Third Edition is a practical, hands-on guide updated for QGIS 2.14 that provides you with clear, step-by-step exercises to help you apply your GIS knowledge to QGIS. Through clear, practical exercises, this book will introduce you to working with QGIS quickly and painlessly.
This book takes you from installing and configuring QGIS to handling spatial data to creating great maps. You will learn how to load and visualize existing spatial data and create data from scratch. You will get to know important plugins, perform common geoprocessing and spatial analysis tasks and automate them with Processing.
We will cover how to achieve great cartographic output and print maps. Finally, you will learn how to extend QGIS using Python and even create your own plugin.
Style and approach
A step by step approach to explain concepts of Geospatial map with the help of real life examples
Read more from Graser Anita
Learn QGIS: Your step-by-step guide to the fundamental of QGIS 3.4, 4th Edition Rating: 0 out of 5 stars0 ratingsQGIS 2 Cookbook Rating: 0 out of 5 stars0 ratingsLearning QGIS - Third Edition Rating: 0 out of 5 stars0 ratings
Related to Learning QGIS - Third Edition
Related ebooks
QGIS By Example Rating: 3 out of 5 stars3/5Mastering QGIS Rating: 4 out of 5 stars4/5ArcPy and ArcGIS – Geospatial Analysis with Python Rating: 0 out of 5 stars0 ratingsAn Introduction to Spatial Data Analysis: Remote Sensing and GIS with Open Source Software Rating: 0 out of 5 stars0 ratingsPython Geospatial Development - Third Edition Rating: 4 out of 5 stars4/5Developing Mobile Web ArcGIS Applications Rating: 0 out of 5 stars0 ratingsArcGIS for Desktop Cookbook Rating: 5 out of 5 stars5/5Learning Geospatial Analysis with Python - Second Edition Rating: 0 out of 5 stars0 ratingsArcGIS By Example Rating: 1 out of 5 stars1/5Learning QGIS 2.0 Rating: 5 out of 5 stars5/5Learning R for Geospatial Analysis Rating: 0 out of 5 stars0 ratingsPython Geospatial Development Rating: 4 out of 5 stars4/5Building Web Applications with ArcGIS Rating: 5 out of 5 stars5/5Geospatial Development By Example with Python Rating: 5 out of 5 stars5/5GeoServer Cookbook Rating: 0 out of 5 stars0 ratingsBuilding Mapping Applications with QGIS Rating: 0 out of 5 stars0 ratingsLeaflet.js Essentials Rating: 4 out of 5 stars4/5Learning ArcGIS Runtime SDK for .NET Rating: 0 out of 5 stars0 ratingsPython Geospatial Development Essentials Rating: 0 out of 5 stars0 ratingsQGIS Blueprints Rating: 0 out of 5 stars0 ratingsGIS Tutorial for ArcGIS Pro 2.8 Rating: 5 out of 5 stars5/5Instructional Guide for The ArcGIS Book Rating: 1 out of 5 stars1/5Python Geospatial Analysis Essentials Rating: 0 out of 5 stars0 ratingsArcGIS Pro 3.x Cookbook: Create, manage, analyze, maintain, and visualize geospatial data using ArcGIS Pro Rating: 0 out of 5 stars0 ratingsLearning D3.js Mapping Rating: 0 out of 5 stars0 ratingsMastering Data Analysis with R Rating: 5 out of 5 stars5/5R for Data Science Rating: 5 out of 5 stars5/5Mastering OpenLayers 3 Rating: 0 out of 5 stars0 ratingsMastering QGIS - Second Edition Rating: 0 out of 5 stars0 ratingsLearning ArcGIS Geodatabases Rating: 5 out of 5 stars5/5
Computers For You
Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Algorithms to Live By: The Computer Science of Human Decisions Rating: 4 out of 5 stars4/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Python for Finance Cookbook: Over 50 recipes for applying modern Python libraries to financial data analysis Rating: 0 out of 5 stars0 ratingsStorytelling with Data: Let's Practice! Rating: 4 out of 5 stars4/5The Alignment Problem: How Can Machines Learn Human Values? Rating: 4 out of 5 stars4/5Python for Beginners: A Crash Course to Learn Python Programming in 1 Week Rating: 0 out of 5 stars0 ratingsITIL Foundation Essentials ITIL 4 Edition - The ultimate revision guide, second edition Rating: 5 out of 5 stars5/5Learn Algorithmic Trading: Build and deploy algorithmic trading systems and strategies using Python and advanced data analysis Rating: 0 out of 5 stars0 ratingsCreating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Blender 3D Basics Beginner's Guide Second Edition Rating: 5 out of 5 stars5/5Learning the Chess Openings Rating: 5 out of 5 stars5/5Angular in Action Rating: 0 out of 5 stars0 ratingsGood Code, Bad Code: Think like a software engineer Rating: 5 out of 5 stars5/5Becoming a Data Head: How to Think, Speak, and Understand Data Science, Statistics, and Machine Learning Rating: 5 out of 5 stars5/5Practical Data Analysis Rating: 4 out of 5 stars4/5Get Into UX: A foolproof guide to getting your first user experience job Rating: 4 out of 5 stars4/5Blender 3D By Example Rating: 4 out of 5 stars4/5Wordpress 2023 A Beginners Guide : Design Your Own Website With WordPress 2023 Rating: 0 out of 5 stars0 ratingsDancing with Qubits: How quantum computing works and how it can change the world Rating: 5 out of 5 stars5/5Fundamentals of Programming: Using Python Rating: 5 out of 5 stars5/5User Experience Foundations Rating: 0 out of 5 stars0 ratings
Reviews for Learning QGIS - Third Edition
2 ratings0 reviews
Book preview
Learning QGIS - Third Edition - Graser Anita
Table of Contents
Learning QGIS Third Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with QGIS
Installing QGIS
Installing QGIS on Windows
Installing on Ubuntu
Running QGIS for the first time
Introducing the QGIS user interface
Finding help and reporting issues
Summary
2. Viewing Spatial Data
Loading vector data from files
Dealing with coordinate reference systems
Loading raster files
Georeferencing raster maps
Loading data from databases
Loading data from OGC web services
Styling raster layers
Styling vector layers
Creating point styles – an example of an airport style
Creating line styles – an example of river or road styles
Creating polygon styles – an example of a landmass style
Loading background maps
Dealing with project files
Summary
3. Data Creation and Editing
Creating new vector layers
Working with feature selection tools
Selecting features with the mouse
Selecting features with expressions
Selecting features using spatial queries
Editing vector geometries
Using basic digitizing tools
Using advanced digitizing tools
Using snapping to enable topologically correct editing
Using measuring tools
Editing attributes
Editing attributes in the attribute table
Editing attributes in the feature form
Creating a feature form using autogenerate
Designing a feature form using drag and drop designer
Designing a feature form using a .ui file
Calculating new attribute values
Reprojecting and converting vector and raster data
Joining tabular data
Setting up a join in Layer Properties
Checking join results in the attribute table
Using temporary scratch layers
Checking for topological errors and fixing them
Finding errors with the Topology Checker
Fixing invalid geometry errors
Adding data to spatial databases
Summary
4. Spatial Analysis
Analyzing raster data
Clipping rasters
Analyzing elevation/terrain data
Using the raster calculator
Combining raster and vector data
Converting between rasters and vectors
Accessing raster and vector layer statistics
Computing zonal statistics
Creating a heatmap from points
Vector and raster analysis with Processing
Finding nearest neighbors
Converting between points, lines, and polygons
Identifying features in the proximity of other features
Sampling a raster at point locations
Mapping density with hexagonal grids
Calculating area shares within a region
Batch-processing multiple datasets
Automated geoprocessing with the graphical modeler
Documenting and sharing models
Leveraging the power of spatial databases
Selecting by location in SpatiaLite
Aggregating data in SpatiaLite
Summary
5. Creating Great Maps
Advanced vector styling
Creating a graduated style
Creating and using color ramps
Using categorized styles for nominal data
Creating a rule-based style for road layers
Creating data-defined symbology
Creating a dynamic heatmap style
Creating a 2.5D style
Adding live layer effects
Working with different styles
Labeling
Customizing label text styles
Controlling label formatting
Configuring label buffers, background, and shadows
Controlling label placement
Configuring point labels
Configuring line labels
Configuring polygon labels
Placing labels manually
Controlling label rendering
Designing print maps
Creating a basic map
Adding a scalebar
Adding a North arrow image
Adding a legend
Adding explanatory text to the map
Adding map grids and frames
Creating overview maps
Adding more details with attribute tables and HTML frames
Creating a map series using the Atlas feature
Presenting your maps online
Exporting a web map
Creating map tiles
Exporting a 3D web map
Summary
6. Extending QGIS with Python
Adding functionality using actions
Configuring your first Python action
Opening files using actions
Opening a web browser using actions
Getting to know the Python Console
Loading and exploring datasets
Styling layers
Filtering data
Creating a memory layer
Exporting map images
Creating custom geoprocessing scripts using Python
Writing your first Processing script
Writing a script with vector layer output
Visualizing the script progress
Developing your first plugin
Creating the plugin template with Plugin Builder
Customizing the plugin GUI
Implementing plugin functionality
Creating a custom map tool
Summary
Index
Learning QGIS Third Edition
Learning QGIS Third Edition
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2013
Second edition: December 2014
Third edition: March 2016
Production reference: 1030316
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-033-9
www.packtpub.com
Credits
Author
Anita Graser
Reviewer
Cornelius Roth
Commissioning Editor
Veena Pagare
Acquisition Editor
Larissa Pinto
Content Development Editor
Prashanth G. Rao
Technical Editor
Tanmayee Patil
Copy Editor
Vikrant Phadke
Project Coordinator
Bijal Patel
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
About the Author
Anita Graser studied geomatics at the University of Applied Sciences Wiener Neustadt, Austria, from where she graduated with a master's degree in 2010. During her studies, she gained hands-on experience in the fields of geo-marketing and transportation research. Since 2007, she has been working as a geographic information systems (GIS) expert with the dynamic transportation systems group at the Austrian Institute of Technology (AIT), where she focuses on analyzing and visualizing spatio-temporal data. Anita serves on the OSGeo board of directors and the QGIS project steering committee. She has been working with GIS since 2005, provides QGIS training courses, and writes a popular blog on open source GIS at anitagraser.com.
I would like to say thanks to my family, partner, and coworkers for their support and encouragement. Of course, I also want to thank the whole QGIS community for their continued efforts to provide the best open source GIS experience possible and everyone who made the previous editions of Learning QGIS such great successes.
About the Reviewer
Cornelius Roth holds a master's degree in geography and geoinformatics at the University of Salzburg. He is currently working at the Department of Geoinformatics on research projects, helping them use GIS-related methods in emergency and air traffic management, open source GIS, and open data.
Recently, he has also worked at the economic development agency BGL, Bavaria, with a strong focus on fostering companies when applying GIS methods and services to support their business objectives. As a third pillar, Cornelius manages e-learning courses for the UNIGIS distance learning network in Salzburg.
www.PacktPub.com
eBooks, discount offers, and more
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlibDo you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Preface
Welcome to the third edition of Learning QGIS. This book aims to introduce you to QGIS 2.14 and show you how to perform core geospatial tasks using this popular open source GIS. It takes you through six chapters from QGIS installation and setup in the first chapter, to the essentials of viewing spatial data in the second chapter. The third chapter covers data creation and editing, followed by the fourth chapter, which offers an introduction to performing spatial analysis in QGIS. In the fifth chapter, you will learn how to create great maps and how to prepare them for print, and the final chapter shows you how you can extend QGIS using the Python scripting language.
What this book covers
Chapter 1, Getting Started with QGIS, covers the installation and configuration of QGIS. We will also see the user interface and how to customize it. By the end of this chapter, you will have QGIS running on your machine and be ready to start with the tutorials.
Chapter 2, Viewing Spatial Data, covers how to view spatial data from different data sources. QGIS supports many file and database formats as well as OGC web services. We will first see how we can load layers from these different data sources. Then, we will look into the basics of styling both vector and raster layers and will create our first map. We will finish this chapter with an example for loading background maps from online services.
Chapter 3, Data Creation and Editing, covers how to create and manipulate spatial datasets. We will cover how to select features and take measurements before we continue with editing feature geometries and attributes. We will then reproject vector and raster data and learn how to convert between different file formats. Furthermore, we will join data from text files and spreadsheets to our spatial data. We will also explore the use of temporary scratch layers, learn how to fix common topological errors, and finally, how to load data into spatial databases.
Chapter 4, Spatial Analysis, covers raster processing and analyses tasks such as clipping and terrain analysis. Then we cover converting between raster and vector formats before we continue with common vector geoprocessing tasks such as generating heatmaps and calculating area shares within a region. Finally, we will finish the chapter with exercises in automating geoprocessing workflows using the QGIS Processing modeler and leveraging the power of spatial databases for analysis.
Chapter 5, Creating Great Maps, covers important features that enable us to create great maps. We will go into advanced vector styling, building on what we learned in Chapter 2, Viewing Spatial Data. Then, we will cover labeling using examples of labeling point locations as well as creating more advanced road labels with road shield graphics. We will also cover how to tweak labels manually. We will get to know the print composer and how to use it to create printable maps and map books. Finally, we will cover solutions to present your maps on the Web.
Chapter 6, Extending QGIS with Python, covers scripting QGIS with Python. We will start with an introduction to actions before we get started with the QGIS Python Console and more advanced development of custom tools for the Processing toolbox. Finally, we will cover how to create our own plugins.
What you need for this book
To follow the exercises in this book, you need QGIS 2.14. QGIS installation is covered in the first chapter and download links for the exercise data are provided in the respective chapters.
Who this book is for
If you are a user, developer, or consultant and want to know how to use QGIS to achieve the results you are used to from other GIS, this is the book for you. This book is not intended to be a GIS textbook. You, the reader, are expected to be comfortable with core GIS concepts.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: use [% $now %] to insert the current time stamp
.
A block of code is set as follows:
( landcover@1 > 0 AND landcover@1 <= 6 ) * 100
+ ( landcover@1 >= 7 AND landcover@1 <= 10 ) * 101
+ ( landcover@1 >= 11 ) * 102
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
def initGui(self): # create the toolbar icon and menu entry
icon_path =