In this chapter, we will cover the following recipes:
Loading a vector layer from a file
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 the distance along a line
Calculating the area of a polygon
Creating a spatial index
Calculating the bearing of a line
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 spend the remainder of the chapter performing spatial and database operations on vector data.