I'm using the action code of this question: "How to create a QGIS Action which loads a raster?"
qgis.utils.iface.addRasterLayer('E:\\Plot Sheet Devt\\1974-1984\\1250k\\[% Grid_Ref %].TIF', '[% Grid_Ref %]')
It is very useful for my work and I would need some more functions. The first one is that the action layer remains selected after the action. Now after loading raster It doesn't remain selected. I tried to add this code:
vl = QgsMapLayerRegistry.instance().mapLayersByName('catalogo_CTR') iface.setActiveLayer(vl)
but It doesn't work.
Other functions could be:
- to automatically assign SRC to loaded rasters
- to create a group of layer where to load the raster.