Re: [Qgis-user] [pyqgis] looping through a raster (andrea antonello)

2023-05-05 Thread andrea antonello via QGIS-User
Hi Doug, Why not call GRASS r.series through the python interface, average the stack > of rasters there, then select the point value from the result. It's a bit > brute force, but when I have used r.series directly in GRASS with hundreds > of large rasters at a time, there was fairly low memory

Re: [Qgis-user] [pyqgis] looping through a raster (andrea antonello)

2023-05-05 Thread Newcomb, Doug via QGIS-User
Andrea, Why not call GRASS r.series through the python interface, average the stack of rasters there, then select the point value from the result. It's a bit brute force, but when I have used r.series directly in GRASS with hundreds of large rasters at a time, there was fairly low memory

Re: [Qgis-user] [pyqgis] looping through a raster

2023-05-05 Thread andrea antonello via QGIS-User
I apologize for my previous badly readable code snippet. Here a better version with a dummy example: # simple raster stats cols = dtmLayer.width(); rows = dtmLayer.height(); minV = 1000 maxV = 0 count = 0 sum = 0 transformType = QgsRasterDataProvider.TransformType.TransformImageToLayer for

[Qgis-user] [pyqgis] looping through a raster

2023-05-05 Thread andrea antonello via QGIS-User
Hello, I am trying to understand how to easily loop through the values of a raster layer using pyqgis. In the docs I see the sample and identify methods of the dataprovider, but can't spot anything that uses rows/cols as a way of iteration. Is the most efficient way to use transformCoordinates to