Hot answers tagged

5

You can use something like the following: layer = qgis.utils.iface.activeLayer() provider = layer.dataProvider() ext = layer.extent() stats = provider.bandStatistics(1,QgsRasterBandStats.All,ext,0) print "minimum value = ", stats.minimumValue print "maximum value = ", stats.maximumValue print "mean = ", stats.mean print "stdDev = ", stats.stdDev Here ...


1

check this: from PyQt4.QtCore import * from PyQt4.QtXml import * myFile = "PATH_TO_COMPOSER_TEMPLATE" myTemplateFile = file(myFile, 'rt') myTemplateContent = myTemplateFile.read() myTemplateFile.close() myDocument = QDomDocument() myDocument.setContent(myTemplateContent, False) newcomp = iface.createNewComposer() ...



Only top voted, non community-wiki answers of a minimum length are eligible