I'm fighting with pyqgis with a very simple issue. I have a raster layer loaded in my TOC and I'd like to return with python its NoData value.
I looked in the API but (and sure it is my lack) I cannot find a way to do that.
So I get my raster as an object in the console:
rl = iface.activeLayer()
and I tried what I found in some websites (see the list at the bottom):
rl.getNoDataValue() #[1]
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'QgsRasterLayer' object has no attribute 'getNoDataValue'
rl.noDataValue() #[2] old API
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'QgsRasterLayer' object has no attribute 'noDataValue'
#[1]: http://qgis.sourceforge.net/qgis_api/html/classQgsRasterLayer.html#a10
#[2]: http://qgis.org/api/1.8/classQgsRasterLayer.html#a558e7f4bb4abe6b95c6882fbe4d2e19f
Look into the QgsRasterLayer
class dir(rl)
but I cannot find a way to return the NoData values.