I would like to load all raster layers with type .xyz which are in a folder into my QGIS Project using PyQGIS and wrote the following function
for lyr in glob.glob(os.path.join(inputDir, "* .xyz")): rasterlyr = QgsRasterLayer(lyr , "") QgsProject.instance().addMapLayers(rasterlyr)
I'm getting the following error message:
QgsProject.addMapLayers(): argument 1 has unexpected type 'QgsRasterLayer'
But according to the Dokumentation "Cheat Sheet" this should actually work.
Does anyone see the mistake?