Pyqgis: Added raster layers do not show up

by jannik schilling   Last Updated July 12, 2019 08:22 AM - source

I have a list ("datList") with names of raster layers which I want to add. When I add raster layers in the python console everything works fine:

for da in datListe:
   layerDir = "C:/[path]/" + da

When I do same in a processing script with...

for da in datListe:
   layerDir = "C:/[path]/" + da
   rlayer = QgsRasterLayer(layerDir,da)

...the layers are not added to my map. However they seem to be in the project as...


...(typed in the python console) prints a list with the desired layers

Related Questions

Use raster memory layer from QGIS processing result

Updated March 06, 2019 16:22 PM

Using in PyQGIS correctly?

Updated November 14, 2016 07:38 AM