QGIS DEM – How to Delete Unused DEMs in a QGIS Project

deletedemqgis

When I download DEMs for a diagonal section of coastline, I am forced to download a rectangular area, which leaves gigabytes of unused data. I want to delete the DEM files for the areas I don't need.

After building my map in QGIS, by importing ASC files as raster layers, is there a way to draw a selection, and remove all layers within that selection or another quick way to delete unwanted DEMs/ASC files?

This describes how to select features within a layer for deletion. My goal is to select layers on the map for deletion.

Best Answer

  1. Merge all the raster layers. Raster>Miscellaneous>Merge
  2. Draw a polygon shapefile representing the area you wish to keep. Layer>Create Layer>Shapefile (polygon)
  3. Crop the merged raster file using the shapefile as a mask, save permanently. Raster>Extraction>Clip raster by mask layer
  4. Delete original raster files!

Thanks to QGIS Community - Official Virtual Group for helping me find the solution.