Joining a shapefile attribute table to a CSV file
Joining attribute tables to other database tables allows you to use a spatial data set to reference a dataset without any geometry, using a common key between the data tables. A very common use case for this is to join a vector dataset of census attributes to a more detailed census attribute dataset. That is the use case we will demonstrate here by linking a US census track file to a detailed Comma Separated Value (CSV) file containing more in-depth information.
Getting ready
For this recipe you will need a census tract shapefile and a CSV file containing the appropriate census data for the shapefile. You can download the sample dataset from the following URL:
https://github.com/GeospatialPython/Learn/raw/master/census.zip
Extract the data to a directory named /qgis_data/census
.
How to do it...
The join operation is quite involved. We'll perform this operation and save the layer as a new shapefile with the joined attributes. Then, we'll load...