Skip to main content
Tweeted twitter.com/StackGIS/status/1375281523922980866
edited body; edited title
Source Link
Jochen Schwarze
  • 14.9k
  • 8
  • 54
  • 120

Set raster layer additional no data value with PyQgisPyQGIS

I need a raster layer transparency configured like this:

enter image description here

Since I load the layer with PyQgisPyQGIS, the parameters should be set programmatically. For global transparency and transparency band I found that it works via myrasterlayer.renderer().setOpacity() and myrasterlayer.renderer().setAlphaBand(0), but I did not find a method to set the additional no data value to 0: http://qgis.org/api/classQgsRasterRenderer.html

How to set this value with PyQgisPyQGIS?

Set raster layer additional no data value with PyQgis

I need a raster layer transparency configured like this:

enter image description here

Since I load the layer with PyQgis, the parameters should be set programmatically. For global transparency and transparency band I found that it works via myrasterlayer.renderer().setOpacity() and myrasterlayer.renderer().setAlphaBand(0), but I did not find a method to set the additional no data value to 0: http://qgis.org/api/classQgsRasterRenderer.html

How to set this value with PyQgis?

Set raster layer additional no data value with PyQGIS

I need a raster layer transparency configured like this:

enter image description here

Since I load the layer with PyQGIS, the parameters should be set programmatically. For global transparency and transparency band I found that it works via myrasterlayer.renderer().setOpacity() and myrasterlayer.renderer().setAlphaBand(0), but I did not find a method to set the additional no data value to 0: http://qgis.org/api/classQgsRasterRenderer.html

How to set this value with PyQGIS?

Source Link
Jochen Schwarze
  • 14.9k
  • 8
  • 54
  • 120

Set raster layer additional no data value with PyQgis

I need a raster layer transparency configured like this:

enter image description here

Since I load the layer with PyQgis, the parameters should be set programmatically. For global transparency and transparency band I found that it works via myrasterlayer.renderer().setOpacity() and myrasterlayer.renderer().setAlphaBand(0), but I did not find a method to set the additional no data value to 0: http://qgis.org/api/classQgsRasterRenderer.html

How to set this value with PyQgis?