[Qgis-user] qgis python script, add raster to bottom of map

Richard Duivenvoorde rdmailings at duif.net
Tue Nov 2 00:38:32 PDT 2021


Maybe this helps:

https://github.com/rduivenvoorde/pdokservicesplugin/commit/176d090f82dff6eeb754371095681135de4ef8e6

This was a Pull Request in which somebody make our WMS plugin always put the reference layer to the bottom.

Regards,

Richard Duivenvoorde

On 11/2/21 6:20 AM, tim dunlevie wrote:
> Hi all,
> 
> I have an index of rasters.
> I have added an action to the QGIS dataset which will open the raster directly into QGIS.
> 
> The script I use is this:
> 
> from qgis.utils import iface
> qgis.utils.iface.addRasterLayer('[% path %]')
> index = QgsProject.instance().mapLayersByName('Catalogue_Raster_Aerial_Photography')[0]
> iface.setActiveLayer(index)
> 
> It works well, except the raster loads to the 'top' of the layer list.
> Is there a command to use so that the image loads to the bottom of the map?
> I prefer to have my index always on top of the list.
> 
> thanks
> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> 



More information about the Qgis-user mailing list