Geographic Information Systems for Public Policy - Lecture XIII

Introduction to QGIS Scripting

Sergio Rey

Last Time

  • Volunteered Geographic Information
  • OpenStreetMap
  • Exercise 4

Today

  • QGIS console
  • Working with layers
  • Exercise 2 in the console

QGIS Console

Working with the console

Using the editor

Working with layers

Changing layer name

Commenting out

Features

Looping

Fields

Exercise 2 in the console

Creating attributes

Create an attribute named pctHISP that reports the percentage of the tract’s total population that is Hispanic.

Creating attributes

Create an attribute named majHISP that takes a value of 1 if pctHISP > 0.50, 0 otherwise

Cloning a layer (saving the original)

Next Up

  • Exercise 4 in the console

Creative Commons License
GIS for Public Policy’20 by Sergio Rey is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.