I want to calculate the zonal statastics from multi band raster for a polygon layer. When I am using this snippet of code:
vectorlayer=qgis.utils.iface.mapCanvas().layer(0)rasterfile = qgis.utils.iface.mapCanvas().layer(1).source()zonalstats = qgis.analysis.QgsZonalStatistics(vectorlayer,rasterfile,"Zonal_")zonalstats.calculateStatistics(None)it is updating the field names but the values are NULL in the attribute table. So if I want to get the values to be updated, how can I do that?
أكثر...
vectorlayer=qgis.utils.iface.mapCanvas().layer(0)rasterfile = qgis.utils.iface.mapCanvas().layer(1).source()zonalstats = qgis.analysis.QgsZonalStatistics(vectorlayer,rasterfile,"Zonal_")zonalstats.calculateStatistics(None)it is updating the field names but the values are NULL in the attribute table. So if I want to get the values to be updated, how can I do that?
أكثر...