Chapter 2. Querying Vector Data

In this chapter, we will cover the following recipes:

  • Loading a vector layer from a file sample
  • Loading a vector layer from a geodatabase
  • Examining vector layer features
  • Examining vector layer attributes
  • Filtering a layer by geometry
  • Filtering a layer by attributes
  • Buffering a feature
  • Measuring the distance between two points
  • Measuring distance along a line
  • Calculating the area of a polygon
  • Creating a spatial index
  • Calculating the bearing of a line
  • Loading data from a spreadsheet
  • Accessing layer metadata

Introduction

This chapter demonstrates how to work with vector data through Python in QGIS. We will first work through loading different sources of vector data. Next, we'll move on to examining the contents of the data. Then, we'll ...

Get QGIS Python Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.