PyQGIS Programmer’s Guide: Extending Qgis 2.X with Python
Book information
Description
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. 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
Similar books
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF
Professional Linux kernel architecture ''Wrox programmer to programmer''--Cover. - ''What you are reading right now is the result of an evolution over more than seven years: After two years of writing, the first edition was published in German by Carl Hanser Verlag in 2003. It then described kernel 2.6.0. The test was used as a basis for the low-level design documentation for the EAL4+ security evaluation of Red Hat Enterprise Linux 5, requiring to update it to kernel 2.6.18 (if the EAL acronym does not mean anything to you, then Wikipedia is once more your friend). Hewlett-Packard sponsored the translation into English and has, thankfully, granted the rights to publish the result. Updates to kernel 2.6.24 were then performed specifically for this book''--P. ix
2008 · PDF