I got number of QgsRectangles and i want to save images bounded by them.
Code written in python:
for box in self.boxes: xs = [box,box,box,box] ys = [box,box,box,box] min_x = min(xs) min_y = min(ys) max_x = max(xs) max_y = max(ys) box = QgsRectangle(min_x,min_y,max_x,max_y) self.iface.mapCanvas().setExtent(box) self.iface.mapCanvas().refresh() time.sleep(1) self.utils.iface.mapCanvas().saveAsImage('%s.tiff' %(str(min_x)))
The problem is script walks over all my boxes, but extents are set only for the last one. I thought qgis will set extents, show location of my box and save an image associated with it.