qgis uk: developing with qgis - what is possible (lutra consulting)
DESCRIPTION
From Pete Wells an overview of the modular structure of QGIS under the hood and the different ways of interacting with the functionality exposed by the API through Python. Includes a list of examples and plugins developed for QGIS with Python.TRANSCRIPT
![Page 1: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/1.jpg)
Developing with QGIS: What’s Possible?
Lutra Consulting
![Page 2: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/2.jpg)
Its internal arrangement
QGIS
Developing with QGIS: What’s Possible?
● QGIS is very modular
● The QGIS you see is a wrapper
around these libraries:
● QgsGui
● QgsAnalysis
● QgsCore
N
![Page 3: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/3.jpg)
What are they?
Python Bindings
● Intermediate layer
● Expose functionality to Python
● Allow functionality to be loaded as a
python module
● Advantages of using Python (over C++):
● Quicker to develop (less lines)
● Code is portable
N
Developing with QGIS: What’s Possible?
![Page 4: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/4.jpg)
Interaction
Plugins
Developing with QGIS: What’s Possible?
● Plugins can be C++ or
Python
● QgisInterface class
provides 'point of
attachment' for plugins
● Only functionality exposed
via QgisInterface can be
used by plugins
● Functionality of
QgisInterface actually
implemented in QGIS
Application
● Plugins 'attach' here
N
![Page 5: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/5.jpg)
Using QgisInterface
Plugins
Developing with QGIS: What’s Possible?
● QgisInterface object facilitates interaction with QGIS through Python:
● Determining layer count
● Loading layers
● Accessing loaded layers
● Accessing features and their geometry
● Etc.
N
![Page 6: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/6.jpg)
GUI library example
Plugins
Developing with QGIS: What’s Possible?
● The GUI library provides a number of GUI elements.
● For example the familiar CRS selector:
N
![Page 7: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/7.jpg)
Core library example
Plugins
Developing with QGIS: What’s Possible?
● The Core library allows us to work with:
● Layers
● Features
● Geometry
● Projections
● Rendering
● Measurement
● Expression engine
● Snapping
● Spatial indexing
N
![Page 8: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/8.jpg)
InaSAFE - Indonesian Scenario Assessment for Emergencies
Example Plugins
Developing with QGIS: What’s Possible?
● A QGIS Plugin that produces realistic natural hazard impact scenarios (e.g. Tsunami).
● Allows for better planning, preparedness and response activities.
● Conceived and initially developed by the Indonesia's National Disaster Management
Agency (BNPB) and the Australian Government.
● Developed by Linfiniti (Tim Sutton)
N
![Page 9: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/9.jpg)
Crayfish
Example Plugins
Developing with QGIS: What’s Possible?
● Plugin for displaying time-varying flood model results
● Used to easily communicate flood risk
● Supports a variety of flood model results including TUFLOW and ISIS 2D
● Developed by Lutra Consulting
N
![Page 10: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/10.jpg)
Brief demo
Crayfish
Developing with QGIS: What’s Possible?
![Page 11: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/11.jpg)
How, Why and When?
Standalone Applications
Developing with QGIS: What’s Possible?
● What is it?
● Simply a program that uses the
QGIS libraries (just like QGIS!)
● Python or C++
● Why? / When?
● When complete flexibility is
required
● When a plugin on top of all of
QGIS is overkill
N
![Page 12: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/12.jpg)
What's possible?
Standalone Applications
Developing with QGIS: What’s Possible?
● Command-line python scripts for automating tasks
● E.g. Using the QGIS Core library to batch-process some shapefiles
● E.g. Extracting and manipulating feature information
● E.g. Batch-printing a number of similar maps
● More complex, graphical applications
● E.g. QGIS Browser
● E.g. A dedicated navigation tool which:
● Reads vector data
● Displays images using the MapCanvas
● Routes between points
● E.g. A dedicated surveying application ...
N
![Page 13: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/13.jpg)
IntraMaps Roam - A Data Collection App by Nathan Woodrow, DMS
Example Standalone Applications
Developing with QGIS: What’s Possible?
N
![Page 14: QGIS UK: Developing with QGIS - What is possible (Lutra Consulting)](https://reader031.vdocuments.site/reader031/viewer/2022020101/55911e2e1a28abc5588b45bb/html5/thumbnails/14.jpg)
Questions?
Developing with QGIS: What’s Possible?