PyQGIS Programmer’s Guide: Extending Qgis 2.X with Python

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Welcome to the world of PyQGIS, the blending of Quantum GIS and Python to extend and enhance your open source GIS toolbox. With PyQGIS you can write scripts and plugins to implement new features and perform automated tasks. This book will guide you in getting started with PyQGIS. After a brief introduction to Python, you'll learn how to understand the QGIS Application Programmer Interface (API), write scripts, and build a plugin. This book is designed to allow you to work through the examples as you go along. At the end of each chapter you will find a set of exercises you can do to enhance your learning experience. The PyQGIS Programmer's Guide is compatible with the version 2.0 API released with QGIS 2.0. Both source code and data to accompany the book are available online.

Author(s): Gary Sherman
Edition: 1
Publisher: Locate Press
Year: 2014

Language: English
Pages: 200

Contents......Page 3
Requirements......Page 11
Conventions Used in this Book......Page 12
Your First PyQGIS experiment......Page 13
Exercises......Page 16
Getting Help......Page 17
Data Structures......Page 18
Classes......Page 21
Strings, Ranges, and Other Handy Things......Page 25
Installing Packages......Page 29
Documenting Your Code......Page 30
Resources to Learn More......Page 32
Exercises......Page 33
Python......Page 35
IDE or Editor......Page 36
Qt/PyQt......Page 38
How Python and QGIS work together......Page 41
Core versus Contributed plugins......Page 42
Managing plugins......Page 43
Python Plugin Specifics......Page 46
Exercises......Page 47
A Simple Example......Page 49
Signals and Slots......Page 51
The Layout of QGIS and PyQt Documentation......Page 52
Choosing Between the Qt and PyQt Documentation......Page 57
Console Features and Options......Page 61
Using the Console Editor......Page 62
Loading a Vector Layer......Page 66
Exploring Vector Symbology......Page 68
Loading a Raster Layer......Page 70
Data Providers......Page 71
Exercises......Page 72
Standalone Scripts in the Console......Page 73
Running Scripts with Script Runner......Page 79
Exercises......Page 84
Loading Vector Layers......Page 85
Working with Databases......Page 89
Working with Symbology......Page 91
Selecting and Working with Features......Page 99
Editing Attributes......Page 101
Saving Images......Page 102
Getting QGIS Paths......Page 103
Messages and Feedback......Page 105
Creating a Map Tool......Page 109
Adding Existing Tools to a Custom Toolbar......Page 113
Accessing an Existing Plugin......Page 114
Setting Up a Repository......Page 115
Exercises......Page 117
The Imports......Page 119
The addOgrLayer and addGdalLayer Functions......Page 120
Using the addLayer Function......Page 122
Changing the Color and Transparency of a Vector Layer......Page 125
Exercises......Page 129
Python Plugin Architecture......Page 131
Creating a Simple Plugin......Page 134
Customizing the Icon......Page 139
Customizing the GUI......Page 141
Writing the Plugin Code......Page 144
One Last Tweak......Page 148
Exercises......Page 151
Creating a Development Workflow......Page 153
Choosing a Development Methodology......Page 154
Debugging......Page 157
Designing the Application......Page 161
Creating a Minimal PyQGIS Application......Page 163
Creating our Own Main Window class......Page 166
Adding Map Tools to the Application......Page 168
Summary......Page 172
Exercises: Python Basics......Page 173
Exercises: Using the Console......Page 174
Exercises: Running Scripts......Page 175
Exercises: Writing Plugins......Page 176
Exercises: Writing a Standalone Application......Page 177
Installing QGIS on Windows with OSGeo4W......Page 179
Installing QGIS on Linux......Page 180
Building QGIS......Page 181
wrapper.py......Page 183
WhereAmI Plugin......Page 185
Standalone Application......Page 188
Changes in __init__.py and metadata.txt......Page 191
SIP API Changes......Page 192
Index......Page 193