Extracting geographic features from a larger dataset in QGIS

You may have noticed that many GIS datasets contain information about a geographic extent that is larger than your area of interest.

Example: This Statistics Canada layer (downloaded from this page), displays all census dissemination areas within Canada. Suppose you only need to work with (for example) Nova Scotia’s dissemination areas. This tutorial will demonstrate how to extract just the features you need, saving them to new files that you can then use to map and analyze your data.

Canada census dissemination area polygons

Using Select by Expression

• Open QGIS and load the layer you’d like to extract a subset of features from.

 Layer to subset in QGIS

• Right-click the layer name in the Layers panel and choose Open attribute table.

 Right-click layer -> Open attribute table

• Click the Select by expression button.

 Attribute table -> Select by expression

• Build a query to select your features of interest (more information on queries in QGIS can be found in the official documentation.). Click Select features, then click Close.

 QGIS selection expression - in this example, "PRUID" = 12

• Result: selected features will be highlighted in yellow on the map canvas, and the count of selected features will be displayed in the QGIS status bar.

 Display of selected features in QGIS.

• Right-click the layer name again and choose Export -> Save Selected Features As…

 Export -> Save selected features as

• Save the output to your computer as an Esri Shapefile. Click OK.

 Save as shapefile

Interactive selections using the attribute table or the map

You can also hand pick individual features for export.

• Open the attribute table.

 Right-click layer -> Open attribute table

• Click the row number box to the left of your record of interest to select it (the High Park dissemination area in Toronto, in this example). The attribute table row and its corresponding map feature will be highlighted. You can Shift-click or Control-click to select multiple records.

 Attribute table with one row selected

• If you’d prefer to select features from the map rather than the attribute table, use the Select tool to do this. Shift-click or Control-click to select multiple map features.

 QGIS select tool

• Once you’ve selected your feature or features of interest, right-click the layer name again and choose Export -> Save Selected Features As…

 Export -> Save selected features as

• Save the output to your computer as an Esri Shapefile. Click OK.

 Save as shapefile

Techniques: Extracting data | Tools: QGIS | Data Format: Vector