By David Crowther
Question:
How can you quicky delete all the records/features in my GIS layer using QGIS?
Answer:
The Truncate Tool within QGIS is perfect for this, but be careful because it makes an ‘in-place’ edit, so all the records in your layer will be deleted and this process cannot be undone!
In QGIS below we have a Point Layer representing some School locations. Before we begin, we will use the Export > Save Features As > in order to work on a copy of this layer.
From the Processing menu choose > Toolbox > and open the Vector General section.
Choose the Truncate Table menu option.
The Truncate Table tool will open.
We will use the following settings:
- In the Input Layer choose - the SchoolsToTruncate
Note – the Truncate Tool will make an ‘in-place’ edit, so all the records in the input layer will be deleted and this process cannot be undone!
If you Run the Truncate Table tool, it will delete all the features in your layer, so your map will now be empty.
If you open the Attributes Table for the layer you can see that the records have also been deleted.
This is a powerful tool, as it can very quickly clear out (truncate) your GIS layers so that you are only left with the Schema (field structure) of your GIS file, now without the records!
Comments (0 comments)