更新时间:2021-07-23 19:49:23
coverpage
QGIS Python Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Conventions
Reader feedback
Customer support
Chapter 1. Automating QGIS
Introduction
Installing QGIS for development
Using the QGIS Python console for interactive control
Using the Python ScriptRunner plugin
Setting up your QGIS IDE
Debugging QGIS Python scripts
Navigating the PyQGIS API
Creating a QGIS plugin
Distributing a plugin
Creating a standalone application
Storing and reading global preferences
Storing and reading project preferences
Accessing the script path from within your script
Chapter 2. Querying Vector Data
Loading a vector layer from a file sample
Loading a vector layer from a spatial database
Examining vector layer features
Examining vector layer attributes
Filtering a layer by geometry
Filtering a layer by attributes
Buffering a feature intermediate
Measuring the distance between two points
Measuring the distance along a line sample
Calculating the area of a polygon
Creating a spatial index
Calculating the bearing of a line
Loading data from a spreadsheet
Chapter 3. Editing Vector Data
Creating a vector layer in memory
Adding a point feature to a vector layer
Adding a line feature to a vector layer
Adding a polygon feature to a vector layer
Adding a set of attributes to a vector layer
Adding a field to a vector layer
Joining a shapefile attribute table to a CSV file
Moving vector layer geometry
Changing a vector layer feature's attribute
Deleting a vector layer feature
Deleting a vector layer attribute
Reprojecting a vector layer
Converting a shapefile to KML
Merging shapefiles
Splitting a shapefile
Generalizing a vector layer
Dissolving vector shapes
Performing a union on vector shapes
Rasterizing a vector layer
Chapter 4. Using Raster Data
Loading a raster layer
Getting the cell size of a raster layer
Obtaining the width and height of a raster
Counting raster bands
Swapping raster bands
Querying the value of a raster at a specified point
Reprojecting a raster
Creating an elevation hillshade
Creating vector contours from elevation data
Sampling a raster dataset using a regular grid
Adding elevation data to line vertices using a digital elevation model
Creating a common extent for rasters
Resampling raster resolution
Counting the unique values in a raster
Mosaicing rasters
Converting a TIFF image to a JPEG image
Creating pyramids for a raster
Converting a pixel location to a map coordinate
Converting a map coordinate to a pixel location
Creating a KML image overlay for a raster
Classifying a raster
Converting a raster to a vector
Georeferencing a raster from control points
Clipping a raster using a shapefile
Chapter 5. Creating Dynamic Maps
Accessing the map canvas
Changing the map units
Iterating over layers
Symbolizing a vector layer
Rendering a single band raster using a color ramp algorithm
Creating a complex vector layer symbol
Using icons as vector layer symbols