Skip to content

Instantly share code, notes, and snippets.

@kgjenkins
Last active February 13, 2020 18:03
Show Gist options
  • Save kgjenkins/096ba3b6ad85bc64a8b2e2dc26b02c19 to your computer and use it in GitHub Desktop.
Save kgjenkins/096ba3b6ad85bc64a8b2e2dc26b02c19 to your computer and use it in GitHub Desktop.
QGIS actions for loading raster tiles from an index map
from qgis.utils import iface
active_layer = iface.activeLayer()

tile = QgsRasterLayer('[%downloadUrl%]')
QgsProject.instance().addMapLayer(tile)
r = QgsHillshadeRenderer(tile.dataProvider(), 1, 315, 45)
tile.setRenderer(r)

iface.setActiveLayer(active_layer)

qgis-load-raster-from-index-map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment