Skip to Content

closeRaster.py

  1. import os
  2. chemin='[% "location" %]'
  3. nomCouche = str(os.path.splitext(os.path.split(chemin)[1])[0])
  4. instRegistry = QgsMapLayerRegistry.instance()
  5. couche = instRegistry.mapLayersByName(nomCouche)
  6. if len(couche) > 0:
  7. instRegistry.removeMapLayer(couche[0].id())