One Step Further: Creating a New Layer out of a Query

Picture you are a specialist of Savoy and you only wish to keep the communes of the two départements covering the former Duchy. You may consider creating a new layer which will only feature those towns. The file size would certainly be lighter.

STEP 1: SELECT FEATURES IN THE ATTRIBUTE TABLE

6 select featuresOpen your attribute table and choose the tool Select features using an expression You know that the two départements you wish to keep are called Savoie and Haute-Savoie. Perform a query as shown below.
6 filter savoie

Savoy is highlighted on your map and in your attribute table, but the rest of the layer is still visible.

6 savoie highlighted

STEP 2: SAVE AS
6 save layer as
Now right click on the layer and choose Save as. Keep the selected CRS, simply choose a name for your new layer (I called it ‘savoy’) and tick the Save only selected features box . Click OK.

 

 

 

 

6 save as

You now have two layers: your original one and your newly created one.

6 two layers

Untick the original one (or even remove it by right clicking on it and selecting Remove). You now have a layer with only the towns your previously selected.

6 final savoy

Last update: 2 June 2015 on QGIS 2.8.1 Wien.

Back to Tutorial 6: Performing Queries | Next tutorial: Data Visualisation on your Map