My intention was to create a new vector layer consisting of several
polygons. I used the CreatePolygon tool to mark the four vertices of a
rectangle. I must have done something wrong because I've ended up with
a polygon that seems to belong to no layer. In desperation I ran the
following python code, hoping to delete the mysterious polygon, but it's
still there. Are some layers not in the legend? How do I get rid of
the polygon?
========================
from qgis.core import QgsProject
from qgis.utils import iface
project = QgsProject.instance()
for lyr in project.mapLayers().values():
lyrName = lyr.name()
print (lyrName)
QgsProject.instance().removeMapLayers([lyr.id()])
_______________________________________________
QGIS-User mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user