[Qgis-developer] select a loaded raster layer from qgis legend into python plugin

Otto Dassau dassau at gbd-consult.de
Thu Jan 17 06:54:44 PST 2013


Hi,

I would like to write a small python plugin to analyse some raster data,
but I haven't managed to select a loaded layer yet. I searched the howtos and
found several simple examples about:

# get the currently active layer
  layer = self.iface.mapCanvas().currentLayer()

but as I said I would like to select one of the loaded raster layers from the
qgis legend using a QtGui.QComboBox in the plugin dialog. At the moment I
tried the getRasterLayersNames() function I found in several other plugins
but it seems I am missing something, because the raster layers are not
selectable. Can someone point me to a simple example to understand the
general procedure?

Thanks a lot
Otto







More information about the Qgis-developer mailing list