Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
QGIS By Example

You're reading from   QGIS By Example Leverage the power of QGIS in real-world applications to become a powerful user in cartography and GIS analysis

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781782174677
Length 316 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Handling Your Data FREE CHAPTER 2. Visualizing and Styling the Data 3. Presenting Data on a Print Map 4. Publishing the Map Online 5. Answering Questions with Density Analysis 6. Answering Questions with Visibility Analysis 7. Answering Questions with Suitability Analysis 8. Automating Analysis with Processing Models 9. Automating Analysis with Processing Scripts 10. Developing a Python Plugin – Select by Radius Index

Defining inputs and outputs


As we have already said, despite models, you can create your own Processing scripts using the Python programming language. Basically, Processing script is Python code plus some additional metadata required by Processing.

Every Processing script starts with a special block of metadata. This information is needed by Processing to register a script as an algorithm and use it from the toolbox, modeler, and so on. Each metadata entry is placed on a new line, starting with the double Python comment symbol (##), and has the following structure:

element_name = element_type [optional_parameters]

Metadata items can be divided into three groups: items that describe the script, items that describe script input, and items that describe script output.

There are only three items that describe the script:

  • group: This is used to define the name of the subgroup inside the Scripts group in the toolbox where the script will be shown. For example, if you put the following line ##Density...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image