QGIS Coding and Compilation Guide

Total Page:16

File Type:pdf, Size:1020Kb

QGIS Coding and Compilation Guide Quantum GIS Coding and Compilation Guide Version 1.1 'Pan' Preamble This document is the original Coding and Compilation Guide of the described software Quantum GIS. The software and hardware described in this document are in most cases registered trademarks and are therefore subject to the legal requirements. Quantum GIS is subject to the GNU General Public License. Find more information on the Quantum GIS Homepage http://qgis.osgeo.org. The details, data, results etc. in this document have been written and verified to the best of knowledge and responsibility of the authors and editors. Nevertheless, mistakes concerning the content are possible. Therefore, all data are not liable to any duties or guarantees. The authors, editors and publishers do not take any responsibility or liability for failures and their consequences. Your are always welcome to indicate possible mistakes. This document has been typeset with LATEX. It is available as LATEX source code via subversion and online as PDF document via http://qgis.osgeo.org/documentation/manuals.html. Translated versions of this document can be downloaded via the documentation area of the QGIS project as well. For more information about contributing to this document and about translating it, please visit: http://www.qgis.org/wiki/index.php/Community_Ressources Links in this Document This document contains internal and external links. Clicking on an internal link moves within the document, while clicking on an external link opens an internet address. In PDF form, internal links are shown in blue, while external links are shown in red and are handled by the system browser. In HTML form, the browser displays and handles both identically. Coding Compilation Guide Authors and Editors: Tim Sutton Marco Hugentobler Gary E. Sherman Tara Athan Godofredo Contreras Werner Macho Carson J.Q. Farmer Otto Dassau Jürgen E. Fischer Davis Wills Magnus Homann Martin Dobias With thanks to Tisham Dhar for preparing the initial msys (MS Windows) environment documentation, to Tom Elwertowski and William Kyngesburye for help in the MAC OSX Installation Section and to Carlos Dávila. If we have neglected to mention any contributors, please accept our apologies for this oversight. Copyright c 2004 - 2009 Quantum GIS Development Team Internet: http://qgis.osgeo.org Contents Contents Title i Preamble ii Table of Contents iii 1 Introduction 1 2 Writing a QGIS Plugin in C++ 2 2.1 Why C++ and what about licensing ............................. 2 2.2 Programming a QGIS C++ Plugin in four steps ...................... 2 2.3 Further information ...................................... 20 3 Creating C++ Applications 21 3.1 Creating a simple mapping widget ............................. 21 3.2 Working with QgsMapCanvas ................................ 24 4 Writing a QGIS Plugin in Python 28 4.1 Why Python and what about licensing ........................... 28 4.2 What needs to be installed to get started .......................... 28 4.3 Programming a simple PyQGIS Plugin in four steps ................... 29 4.4 Uploading the plugin to the repository ........................... 32 4.5 Further information ...................................... 32 5 Creating PyQGIS Applications 34 5.1 Designing the GUI ...................................... 34 5.2 Creating the MainWindow .................................. 35 5.3 Finishing Up ......................................... 39 5.4 Running the Application ................................... 40 6 Installation Guide 43 6.1 An overview of the dependencies required for building .................. 43 7 Building under windows using msys 44 7.1 MSYS: ............................................. 44 7.2 Qt4.3 ............................................. 44 7.3 Flex and Bison ........................................ 45 7.4 Python stuff: (optional) .................................... 45 7.4.1 Download and install Python - use Windows installer ............... 45 7.4.2 Download SIP and PyQt4 sources ......................... 45 7.4.3 Compile SIP ..................................... 46 7.4.4 Compile PyQt ..................................... 46 QGIS 1.1 Installation and Coding Guide iii Contents 7.4.5 Final python notes .................................. 46 7.5 Subversion: .......................................... 46 7.6 CMake: ............................................ 46 7.7 QGIS: ............................................. 46 7.8 Compiling: ........................................... 47 7.9 Configuration ......................................... 47 7.10 Compilation and installation ................................. 48 7.11 Run qgis.exe from the directory where it’s installed (CMAKE_INSTALL_PREFIX) ... 48 7.12 Create the installation package: (optional) ......................... 48 8 Building on Mac OSX using frameworks and cmake (QGIS > 0.8) 48 8.1 Install XCODE ........................................ 49 8.2 Install Qt4 from .dmg ..................................... 49 8.3 Install development frameworks for QGIS dependencies ................. 50 8.3.1 Additional Dependencies : GSL ........................... 50 8.3.2 Additional Dependencies : Expat .......................... 50 8.3.3 Additional Dependencies : SIP ........................... 51 8.3.4 Additional Dependencies : PyQt .......................... 52 8.3.5 Additional Dependencies : Bison .......................... 52 8.4 Install CMAKE for OSX ................................... 53 8.5 Install subversion for OSX .................................. 53 8.6 Check out QGIS from SVN ................................. 54 8.7 Configure the build ...................................... 55 8.8 Building ............................................ 56 9 Building on GNU/Linux 56 9.1 Building QGIS with Qt4.x .................................. 56 9.2 Prepare apt .......................................... 57 9.3 Install Qt4 ........................................... 57 9.4 Install additional software dependencies required by QGIS ................ 58 9.5 GRASS Specific Steps .................................... 58 9.6 Setup ccache (Optional) ................................... 58 9.7 Prepare your development environment .......................... 59 9.8 Check out the QGIS Source Code ............................. 59 9.9 Starting the compile ..................................... 60 9.10 Building Debian packages .................................. 61 9.11 Running QGIS ........................................ 61 10 Creation of MSYS environment for compilation of Quantum GIS 62 10.1 Initial setup .......................................... 62 10.1.1 MSYS ......................................... 62 10.1.2 MinGW ........................................ 62 10.1.3 Flex and Bison .................................... 62 QGIS 1.1 Installation and Coding Guide iv Contents 10.2 Installing dependencies ................................... 63 10.2.1 Getting ready ..................................... 63 10.2.2 GDAL level one .................................... 63 10.2.3 GRASS ........................................ 65 10.2.4 GDAL level two .................................... 66 10.2.5 GEOS ......................................... 66 10.2.6 SQLITE ........................................ 67 10.2.7 GSL .......................................... 67 10.2.8 EXPAT ......................................... 68 10.2.9 POSTGRES ..................................... 68 10.3 Cleanup ............................................ 68 11 Building with MS Visual Studio 68 11.1 Setup Visual Studio ..................................... 68 11.1.1 Express Edition .................................... 69 11.1.2 All Editions ...................................... 69 11.2 Download/Install Dependencies ............................... 69 11.2.1 Flex and Bison .................................... 69 11.2.2 To include PostgreSQL support in Qt ........................ 70 11.2.3 Qt ........................................... 70 11.2.4 Proj.4 ......................................... 71 11.2.5 GSL .......................................... 71 11.2.6 GEOS ......................................... 71 11.2.7 GDAL ......................................... 72 11.2.8 PostGIS ........................................ 73 11.2.9 Expat ......................................... 73 11.2.10CMake ........................................ 73 11.3 Building QGIS with CMAKE ................................. 73 12 Building under Windows using MSVC Express 74 12.1 System preparation ..................................... 74 12.2 Install the libraries archive .................................. 75 12.3 Install Visual Studio Express 2005 ............................. 75 12.4 Install Microsoft Platform SDK2 ............................... 76 12.5 Edit your vsvars ........................................ 78 12.6 Environment Variables .................................... 80 12.7 Building Qt4.3.2 ....................................... 81 12.7.1 Compile Qt ...................................... 81 12.7.2 Configure Visual C++ to use Qt ........................... 81 12.8 Install Python ......................................... 82 12.9 Install SIP ........................................... 82 12.10Install PyQt4 ......................................... 83 QGIS 1.1 Installation and Coding Guide v Contents 12.11Install CMake ......................................... 83 12.12Install Subversion ....................................... 83 12.13Initial SVN Check out .................................... 84 12.14Create
Recommended publications
  • Freiesmagazin 12/2012
    freiesMagazin Dezember 2012 Topthemen dieser Ausgabe Slackware 14.0 Seite 3 Die wohl älteste noch aktive Linux-Distribution hat nach überdurchschnittlich langer Entwick- lungszeit die neue Version 14.0 veröffentlicht. Der Artikel gibt eine Übersicht über Altes und Neues, was sich seit Version 9.0 so alles geändert hat – und was nicht. (weiterlesen) Video Disk Recoder auf Basis von easyVDR 1.0 Seite 10 Der Artikel erklärt den Aufbau eines MediaCenters auf Basis der Distribution easyVDR und stellt die Neuerungen der Version 1.0 sowie deren Installation und Konfiguration vor. Der Schwerpunkt des Artikels liegt dabei in der Hardwareauswahl und den neuen Features der jetzt auf der Linux-Distribution Ubuntu basierten Version 1.0 sowie der „easy“ Inbetriebnahme dieser. (weiterlesen) Softmaker Office 2012 Seite 25 Der Markt für Büroprogramme ist unübersichtlich: In der Windows-Welt gilt Microsoft Office trotz der saftigen Preise immer noch als Referenz. Unter Linux dürfte dagegen LibreOffice mitt- lerweile den Stand eines Standards erreicht haben. Hinzu kommen noch zahlreiche freie An- wendungen und diverse kommerzielle Alternativen. Eines der Programme mit professionellem Anspruch ist SoftMaker Office, das nicht nur Nischenmärkte unter verschiedenen Systemen besetzen, sondern eine Alternative zu den Platzhirschen sein will. (weiterlesen) © freiesMagazin CC-BY-SA 3.0 Ausgabe 12/2012 ISSN 1867-7991 MAGAZIN Editorial Sechster Programmierwettbewerb werden dann ebenfalls einige Meta-Daten zu der Inhalt Linux allgemein Im März 2012 gab es mit dem fünften Wett- jeweiligen Ausgabe angezeigt. Slackware 14.0 S. 3 bewerb ein kleines Zwischenspiel außer der Aber auch so haben wir weiter an der CSS-Datei Video Disk Recoder auf Basis von S.
    [Show full text]
  • Gpsbabel Documentation Gpsbabel Documentation Table of Contents
    GPSBabel Documentation GPSBabel Documentation Table of Contents Introduction to GPSBabel ................................................................................................... xx The Problem: Too many incompatible GPS file formats ................................................... xx The Solution ............................................................................................................ xx 1. Getting or Building GPSBabel .......................................................................................... 1 Downloading - the easy way. ....................................................................................... 1 Building from source. .................................................................................................. 1 2. Usage ........................................................................................................................... 3 Invocation ................................................................................................................. 3 Suboptions ................................................................................................................ 4 Advanced Usage ........................................................................................................ 4 Route and Track Modes .............................................................................................. 5 Working with predefined options .................................................................................. 6 Realtime tracking ......................................................................................................
    [Show full text]
  • GPLIGC & OGIE Version 1.9 Manual
    GPLIGC & OGIE Version 1.9 Manual Hannes Kruger¨ December 16, 2010 1 47.0789◦N 11.3060◦E CONTENTS 3 Contents 1 Introduction 5 1.1 GPLIGC..............................................5 1.2 OGIE...............................................6 1.3 Contact, Bug reports, feature requests.............................6 2 Requirements 6 3 Installation 7 3.1 General Linux and Unix installation procedure........................7 3.1.1 Compiling OGIE.....................................8 3.2 OpenBSD.............................................8 3.3 Gentoo Linux...........................................8 3.4 Mac OS X.............................................9 3.4.1 General..........................................9 3.4.2 Matthew's howto, using fink...............................9 3.4.3 Michael Schlotter's howto................................ 10 3.5 Windows NT/2000/2003/XP/Vista/2008/Win7........................ 10 3.6 Update installation........................................ 11 3.7 Additional Perl modules..................................... 11 3.7.1 Image::ExifTool...................................... 11 3.8 Digital Elevation Model..................................... 12 3.8.1 GTOPO30, SRTM30................................... 12 3.8.2 ETOPO2 (and merging it into the GTOPO30).................... 13 3.8.3 GLOBE.......................................... 13 3.8.4 SRTM30 Plus (TOPO30)................................ 13 3.8.5 SRTM-1 and SRTM-3.................................. 13 3.8.6 SRTM-1 and SRTM-3 finished from seamless server................
    [Show full text]
  • Tinn-R Team Has a New Member Working on the Source Code: Wel- Come Huashan Chen
    Editus eBook Series Editus eBooks is a series of electronic books aimed at students and re- searchers of arts and sciences in general. Tinn-R Editor (2010 1. ed. Rmetrics) Tinn-R Editor - GUI forR Language and Environment (2014 2. ed. Editus) José Cláudio Faria Philippe Grosjean Enio Galinkin Jelihovschi Ricardo Pietrobon Philipe Silva Farias Universidade Estadual de Santa Cruz GOVERNO DO ESTADO DA BAHIA JAQUES WAGNER - GOVERNADOR SECRETARIA DE EDUCAÇÃO OSVALDO BARRETO FILHO - SECRETÁRIO UNIVERSIDADE ESTADUAL DE SANTA CRUZ ADÉLIA MARIA CARVALHO DE MELO PINHEIRO - REITORA EVANDRO SENA FREIRE - VICE-REITOR DIRETORA DA EDITUS RITA VIRGINIA ALVES SANTOS ARGOLLO Conselho Editorial: Rita Virginia Alves Santos Argollo – Presidente Andréa de Azevedo Morégula André Luiz Rosa Ribeiro Adriana dos Santos Reis Lemos Dorival de Freitas Evandro Sena Freire Francisco Mendes Costa José Montival Alencar Junior Lurdes Bertol Rocha Maria Laura de Oliveira Gomes Marileide dos Santos de Oliveira Raimunda Alves Moreira de Assis Roseanne Montargil Rocha Silvia Maria Santos Carvalho Copyright©2015 by JOSÉ CLÁUDIO FARIA PHILIPPE GROSJEAN ENIO GALINKIN JELIHOVSCHI RICARDO PIETROBON PHILIPE SILVA FARIAS Direitos desta edição reservados à EDITUS - EDITORA DA UESC A reprodução não autorizada desta publicação, por qualquer meio, seja total ou parcial, constitui violação da Lei nº 9.610/98. Depósito legal na Biblioteca Nacional, conforme Lei nº 10.994, de 14 de dezembro de 2004. CAPA Carolina Sartório Faria REVISÃO Amek Traduções Dados Internacionais de Catalogação na Publicação (CIP) T591 Tinn-R Editor – GUI for R Language and Environment / José Cláudio Faria [et al.]. – 2. ed. – Ilhéus, BA : Editus, 2015. xvii, 279 p. ; pdf Texto em inglês.
    [Show full text]
  • Interfacing Gaudi with Python Objectives
    8 Interfacing Gaudi with Python Gaudi Framework Tutorial, 2004 Objectives After completing this lesson, you should be able to: • Understand how Gaudi is interfaced to Python • Convince you that Python is a very good programming language for Rapid Prototyping • Write simple Python scripts to access LHCb data 8-2 Gaudi Framework Tutorial, 2004 Python Language Python is an Open Source programming language created by Guido van Rossum. While it has been available since 1990, it has recently seen a dramatic increase in popularity in a wide variety of domains Python is simple, elegant, powerful and reliable Features: • Variables & Arithmetic expressions • String manipulations • Conditionals (if/else statements), Loops (for/while) • Functions, Lists, Dictionaries, Classes (Objects), Exceptions , Modules 8-3 Gaudi Framework Tutorial, 2004 Why Python? Free, Open-Source, Maintainable Cross-Platform, Portable General-Purpose, High-level, Object-Oriented Interpreted • However it is quite fast (byte code idea from Java) Dynamically typed, Introspective • Not need to declare any variable Simple syntax, Robust • Emphasis by the author to minimize typing Variety of Shells Powerful built-in types and modules Î Ideal for Scripting and Prototyping 8-4 Gaudi Framework Tutorial, 2004 Python as a “Glue” Extension Modules • Very easy to interface to C++ classes (C-API) Collaborative • Extension modules can be plugged and used together Very rich set LHC modules specialized generic modules Several GUI toolkits EDG API PVSS XML Database GUIGUI Python shell JPE PyROOT gaudipython mathmath Gateways to other frameworks Java Root Gaudi Very rich set Classes Classes Framework of Python standard 8-5 Gaudi Framework Tutorial, 2004 modules Python Binding Techniques Python provides a very complete C-API • By hand bindings are possible but even for medium-sized projects, it becomes cumbersome and unmaintainable.
    [Show full text]
  • Google Earth User Guide
    Google Earth User Guide ● Table of Contents Introduction ● Introduction This user guide describes Google Earth Version 4 and later. ❍ Getting to Know Google Welcome to Google Earth! Once you download and install Google Earth, your Earth computer becomes a window to anywhere on the planet, allowing you to view high- ❍ Five Cool, Easy Things resolution aerial and satellite imagery, elevation terrain, road and street labels, You Can Do in Google business listings, and more. See Five Cool, Easy Things You Can Do in Google Earth Earth. ❍ New Features in Version 4.0 ❍ Installing Google Earth Use the following topics to For other topics in this documentation, ❍ System Requirements learn Google Earth basics - see the table of contents (left) or check ❍ Changing Languages navigating the globe, out these important topics: ❍ Additional Support searching, printing, and more: ● Making movies with Google ❍ Selecting a Server Earth ❍ Deactivating Google ● Getting to know Earth Plus, Pro or EC ● Using layers Google Earth ❍ Navigating in Google ● Using places Earth ● New features in Version 4.0 ● Managing search results ■ Using a Mouse ● Navigating in Google ● Measuring distances and areas ■ Using the Earth Navigation Controls ● Drawing paths and polygons ● ■ Finding places and Tilting and Viewing ● Using image overlays Hilly Terrain directions ● Using GPS devices with Google ■ Resetting the ● Marking places on Earth Default View the earth ■ Setting the Start ● Location Showing or hiding points of interest ● Finding Places and ● Directions Tilting and
    [Show full text]
  • The Kdesvn Handbook
    The kdesvn Handbook Rajko Albrecht The kdesvn Handbook 2 Contents 1 Introduction 7 1.1 Terms . .7 2 Using kdesvn 8 2.1 kdesvn features . .8 2.2 Beginning with subversion and kdesvn . .8 2.2.1 Creating a working copy . .9 2.2.2 Committing local changes . .9 2.2.3 Update working copy . .9 2.2.4 Adding and Deleting from working copy . .9 2.2.4.1 Add items . 10 2.2.4.2 Deleting items from working copy and unversion . 10 2.2.5 Displaying logs . 10 2.2.5.1 The log display dialog . 10 2.3 Working on repositories . 11 2.3.1 Restoring deleted items . 11 2.3.2 Importing folders . 11 2.3.2.1 With drag and drop . 11 2.3.2.2 Select folder to import with directory-browser . 11 2.4 Other Operations . 11 2.4.1 Merge . 11 2.4.1.1 Internal merge . 12 2.4.1.2 Using external program for merge . 12 2.4.2 Resolving conflicts . 12 2.5 Properties used by kdesvn for configuration . 13 2.5.1 Bugtracker integration . 13 2.6 The revision tree . 13 2.6.1 Requirements . 14 2.7 Internal log cache . 14 2.7.1 Offline mode . 14 2.7.2 Log cache and revision tree . 14 The kdesvn Handbook 2.8 Meaning of icon overlays . 14 2.9 kdesvn and passwords . 16 2.9.1 Not saving passwords . 16 2.9.2 Saving passwords in KWallet . 16 2.9.3 Saving to subversion’s own password storage .
    [Show full text]
  • Ethereal Developer's Guide Draft 0.0.2 (15684) for Ethereal 0.10.11
    Ethereal Developer's Guide Draft 0.0.2 (15684) for Ethereal 0.10.11 Ulf Lamping, Ethereal Developer's Guide: Draft 0.0.2 (15684) for Ethere- al 0.10.11 by Ulf Lamping Copyright © 2004-2005 Ulf Lamping Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation. All logos and trademarks in this document are property of their respective owner. Table of Contents Preface .............................................................................................................................. vii 1. Foreword ............................................................................................................... vii 2. Who should read this document? ............................................................................... viii 3. Acknowledgements ................................................................................................... ix 4. About this document .................................................................................................. x 5. Where to get the latest copy of this document? ............................................................... xi 6. Providing feedback about this document ...................................................................... xii I. Ethereal Build Environment ................................................................................................14 1. Introduction .............................................................................................................15
    [Show full text]
  • A Compiler Front-End for the WOOL Parallelization Library
    A compiler front-end for the WOOL Parallelization library GEORGIOS VARISTEAS KTH Information and Communication Technology Master of Science Thesis Stockholm, Sweden 2010 TRITA-ICT-EX-2010:291 Royal Institute of Technology A compiler front-end for the WOOL Parallelization library Georgios Varisteas yorgos(@)kth.se 15 October, 2010 A master thesis project conducted at Examiner: Mats Brorsson Supervisor: Karl-Filip Faxén Abstract WOOL is a C parallelization library developed at SICS by Karl-Filip Faxén. It provides the tools for develop- ing fine grained independent task based parallel applications. This library is distinguished from other similar projects by being really fast and light; it manages to spawn and synchronize tasks in under 20 cycles. However, all software development frameworks which expose radically new functionality to a programming language, gain a lot by having a compiler to encapsulate and implement them. WOOL does not differ from this category. This project is about the development of a source-to-source compiler for the WOOL parallelization library, supporting an extension of the C language with new syntax that implements the WOOL API, transform- ing it and eventually outputting GNU C code. Additionally, this compiler is augmented with a wrapper script that performs compilation to machine code by using GCC. This script is configurable and fully automatic. The main advantage gained from this project is to satisfy the need for less overhead in software development with WOOL. The simplified syntax results in faster and more economical code writing while being less error- prone. Moreover, this compiler enables the future addition of many more features not applicable with the current state of WOOL as a library.
    [Show full text]
  • Pyqgis Developer Cookbook Release 2.18
    PyQGIS developer cookbook Release 2.18 QGIS Project April 08, 2019 Contents 1 Introduction 1 1.1 Run Python code when QGIS starts.................................1 1.2 Python Console............................................2 1.3 Python Plugins............................................3 1.4 Python Applications.........................................3 2 Loading Projects 7 3 Loading Layers 9 3.1 Vector Layers.............................................9 3.2 Raster Layers............................................. 11 3.3 Map Layer Registry......................................... 11 4 Using Raster Layers 13 4.1 Layer Details............................................. 13 4.2 Renderer............................................... 13 4.3 Refreshing Layers.......................................... 15 4.4 Query Values............................................. 15 5 Using Vector Layers 17 5.1 Retrieving information about attributes............................... 17 5.2 Selecting features........................................... 18 5.3 Iterating over Vector Layer...................................... 18 5.4 Modifying Vector Layers....................................... 20 5.5 Modifying Vector Layers with an Editing Buffer.......................... 22 5.6 Using Spatial Index......................................... 23 5.7 Writing Vector Layers........................................ 23 5.8 Memory Provider........................................... 24 5.9 Appearance (Symbology) of Vector Layers............................. 26 5.10 Further
    [Show full text]
  • Development of Educational Materials
    InSIDE: Including Students with Impairments in Distance Education Delivery Development of educational DEV2.1 materials Eleni Koustriava1, Konstantinos Papadopoulos1, Konstantinos Authors Charitakis1 Partner University of Macedonia (UOM)1, Johannes Kepler University (JKU) Work Package WP2: Adapted educational material Issue Date 31-05-2020 Report Status Final This project (598763-EPP-1-2018-1-EL-EPPKA2-CBHE- JP) has been co-funded by the Erasmus+ Programme of the European Commission. This publication [communication] reflects the views only of the authors, and the Commission cannot be held responsible for any use which may be made of the information contained therein Project Partners University of National and Macedonia, Greece Kapodistrian University of Athens, Coordinator Greece Johannes Kepler University of Aboubekr University, Austria Belkaid Tlemcen, Algeria Mouloud Mammeri Blida 2 University, Algeria University of Tizi-Ouzou, Algeria University of Sciences Ibn Tofail university, and Technology of Oran Morocco Mohamed Boudiaf, Algeria Cadi Ayyad University of Sfax, Tunisia University, Morocco Abdelmalek Essaadi University of Tunis El University, Morocco Manar, Tunisia University of University of Sousse, Mohammed V in Tunisia Rabat, Morocco InSIDE project Page WP2: Adapted educational material 2018-3218 /001-001 [2|103] DEV2.1: Development of Educational Materials Project Information Project Number 598763-EPP-1-2018-1-EL-EPPKA2-CBHE-JP Grant Agreement 2018-3218 /001-001 Number Action code CBHE-JP Project Acronym InSIDE Project Title
    [Show full text]
  • Pyqgis Testing Developer Cookbook
    PyQGIS testing developer cookbook QGIS Project Sep 25, 2021 CONTENTS 1 Introduction 1 1.1 Scripting in the Python Console ................................... 1 1.2 Python Plugins ............................................ 2 1.2.1 Processing Plugins ...................................... 3 1.3 Running Python code when QGIS starts ............................... 3 1.3.1 The startup.py file ................................... 3 1.3.2 The PYQGIS_STARTUP environment variable ...................... 3 1.4 Python Applications ......................................... 3 1.4.1 Using PyQGIS in standalone scripts ............................. 4 1.4.2 Using PyQGIS in custom applications ............................ 5 1.4.3 Running Custom Applications ................................ 5 1.5 Technical notes on PyQt and SIP ................................... 6 2 Loading Projects 7 2.1 Resolving bad paths .......................................... 8 3 Loading Layers 9 3.1 Vector Layers ............................................. 9 3.2 Raster Layers ............................................. 12 3.3 QgsProject instance .......................................... 14 4 Accessing the Table Of Contents (TOC) 15 4.1 The QgsProject class ......................................... 15 4.2 QgsLayerTreeGroup class ...................................... 16 5 Using Raster Layers 19 5.1 Layer Details ............................................. 19 5.2 Renderer ............................................... 20 5.2.1 Single Band Rasters ....................................
    [Show full text]