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
Introduction
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
Introduction
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
Introduction
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
Introduction
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
Creating a graduated vector layer symbol renderer
Creating a categorized vector layer symbol
Creating a map bookmark
Navigating to a map bookmark
Setting scale-based visibility for a layer
Using SVG for layer symbols
Using pie charts for symbols
Using the OpenStreetMap service
Using the Bing aerial image service
Adding real-time weather data from OpenWeatherMap
Labeling features
Changing map layer transparency
Adding standard map tools to the canvas
Using a map tool to draw points on the canvas
Using a map tool to draw polygons or lines on the canvas
Building a custom selection tool
Creating a mouse coordinate tracking tool
Chapter 6. Composing Static Maps
Introduction
Creating the simplest map renderer
Using the map composer
Adding labels to a map for printing
Adding a scale bar to the map
Adding a north arrow to the map
Adding a logo to the map
Adding a legend to the map
Adding a custom shape to the map
Adding a grid to the map
Adding a table to the map
Adding a world file to a map image
Saving a map to a project
Loading a map from a project
Chapter 7. Interacting with the User
Introduction
Using log files
Creating a simple message dialog
Creating a warning dialog
Creating an error dialog
Displaying a progress bar
Creating a simple text input dialog
Creating a file input dialog
Creating a combobox
Creating radio buttons
Creating checkboxes
Creating tabs
Stepping the user through a wizard
Keeping dialogs on top
Chapter 8. QGIS Workflows
Introduction
Creating an NDVI
Geocoding addresses
Creating raster footprints
Performing network analysis
Routing along streets
Tracking a GPS
Creating a mapbook
Finding the least cost path
Performing nearest neighbor analysis
Creating a heat map
Creating a dot density map
Collecting field data
Computing road slope using elevation data
Geolocating photos on the map
Image change detection
Chapter 9. Other Tips and Tricks
Introduction
Creating tiles from a QGIS map
Adding a layer to geojson.io
Rendering map layers based on rules
Creating a layer style file
Using NULL values in PyQGIS
Using generators for layer queries
Using alpha values to show data density
Using the __geo_interface__ protocol
Generating points along a line
Using expression-based labels
Creating dynamic forms in QGIS
Calculating length for all selected lines
Using a different status bar CRS than the map
Creating HTML labels in QGIS
Using OpenStreetMap's points of interest in QGIS
Visualizing data in 3D with WebGL
Visualizing data on a globe
Index
更新时间:2021-07-23 19:49:23