[GIS] How to delete lines from the QGIS canvas which no longer are attached to a shapefile

linestringqgisshapefile

Using QGIS 2.18.1, I started to create a shapefile layer with a line feature, but then decided not to proceed. I first tried to select and delete the lines but couldn't seem to select them with the select tool. So I then deleted the shapefiles using File Explorer which seemed to go as expected. However, the lines are still on the canvas, and appear to be impossible to delete, and of course are no longer associated with a layer . How can I clear the canvas of these lines?

Best Answer

  1. select the relevant layer in the Layer Panel and activate the editing
  2. Select the orphan line segment with the selection tool in the editing toolbar
  3. Press the delete key of your key board

That's all.

Related Question