<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">hello frank, for the OSM problem, see thread: <div> "Printing with OSM layer"</div><div>form earlier today and the answers of Joost and Paulo to that. </div><div><br></div><div><br><div><div style="margin: 0px 0px 0px 4px;"><br></div><div style="margin: 0px 0px 0px 4px;"><br></div><div><div>Op 4-nov.-2014, om 13:59 heeft Frank van Baar <<a href="mailto:frank@van-baar.com">frank@van-baar.com</a>> het volgende geschreven:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="NL" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Hi Joris,<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Thanks for your suggestion – didn’t realize atlas worked this way. It however does not completely do what I want to do – the layer which it changes the filter for also has specific formatting to highlight the region etc. AND the OSM layer doesn’t always display right.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Any other suggestions anyone?<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"><br>Frank<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0cm 0cm;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;">Van:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"><span class="Apple-converted-space"> </span>Joris Hintjens [<a href="mailto:jorishin@gmail.com">mailto:jorishin@gmail.com</a>]<span class="Apple-converted-space"> </span><br><b>Verzonden:</b><span class="Apple-converted-space"> </span>04 November 2014 11:27<br><b>Aan:</b><span class="Apple-converted-space"> </span>Frank van Baar<br><b>CC:</b><span class="Apple-converted-space"> </span><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br><b>Onderwerp:</b><span class="Apple-converted-space"> </span>Re: [Qgis-user] Python script to iterate through attributes and then refresh the canvas - doesn't show any map....<o:p></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Why not use atlas generation in the print composer?<o:p></o:p></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> Seems to me this corresponds with your „what i’m trying to achieve”<o:p></o:p></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">grts<o:p></o:p></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Joris<o:p></o:p></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Op 4-nov.-2014, om 09:14 heeft Frank van Baar <<a href="mailto:frank@van-baar.com" style="color: purple; text-decoration: underline;">frank@van-baar.com</a>> het volgende geschreven:<o:p></o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><br><br><o:p></o:p></div><div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Hi,</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Am</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">completely</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">stuck with a</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">QGIS</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">project in Python and tried everything but nothing seems to work.</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">The python script does work</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">as such</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">BUT the canvas never shows the map and therefor the exported maps are empty….</span><span lang="EN-US"></span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">What I’m trying to achieve:</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Symbol; color: rgb(31, 73, 125);">·</span><span lang="EN-US" style="font-family: 'Courier New'; color: rgb(31, 73, 125);"> </span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Create a Python script that iterates through a series of</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">ca. 2500</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">polygons</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">based on attribute value, zoom to layer extend and save the canvas for each attribute as an image file.</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Symbol; color: rgb(31, 73, 125);">·</span><span lang="EN-US" style="font-family: 'Courier New'; color: rgb(31, 73, 125);"> </span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">I then use the image files in other</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">documents</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">The issue is that while manually I get the canvas to reload and display the map, this doesn’t happen when running the python script. Have tried couple of ways:</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">1. </span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Don’t load the project each time and just change the filter</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">2. </span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Add sleep timers to give the canvas time to refresh etc.</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">3. </span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Tried different QGIS versions (2.2, 2.4 & 2.6 on Win 64x)</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">But all to no avail….</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Hope somebody’s got a great idea how to solve it.</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Regards,</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Frank</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><i><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Python code:</span></i><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"># File location & specifications</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">PROJECTPATH = 'C:/Users/Frank/Documents</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">/Targetting/Kaarten/'</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">PROJECTFILE = 'C:/Users/Frank/Documents</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">/Targetting/TargettingkaartV26qgs.qgs'</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">EXTSNAPSHOTS = '.jpg'</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">EXTSNAPSHOTS2 = '.png'</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">SUFFIX = '65Plus_v1'</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">last_id = 1</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">while last_id < 5:</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"># Clear map canvas</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">QgsMapLayerRegistry.instance().removeAllMapLayers()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.mapCanvas().refresh()</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> </span><o:p></o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"># Open QGIS project</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">QgsProject.instance().setFileName(PROJECTFILE)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">QgsProject.instance().read()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.mapCanvas().refresh()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">time.sleep(30) </span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">canvas = qgis.utils.iface.mapCanvas()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">acl = canvas.layer(0)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.mapCanvas().layer(0).selectAll()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">selection = 'RijNo = ' + str(last_id)</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> </span><o:p></o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">acl.setSubsetString( selection )</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">acl.triggerRepaint</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">canvas.layer(1).triggerRepaint </span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">time.sleep(5) </span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.setActiveLayer(acl)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"># Zoom in and out to refresh potential issues with OpenLayer</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">canvas.zoomByFactor(3)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">canvas.zoomByFactor(0.5)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.zoomToActiveLayer()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.mapCanvas().refresh()</span><o:p></o:p></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> </span><o:p></o:p></div></div><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">time.sleep(10)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"># Save project</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">p=QgsProject.instance()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">p.setFileName(PROJECTFILE)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">p.write()</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> <span class="Apple-converted-space"> </span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"># Save content of map canvas as image</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> </span><span lang="EN-US"> </span><span style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">p = str(last_id) + 'kaart_'</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"> <span class="Apple-converted-space"> </span><span lang="EN-US" style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">qgis.utils.iface.mapCanvas().saveAsImage(PROJECTPATH+ p + SUFFIX + EXTSNAPSHOTS)</span><o:p></o:p></p><p style="margin-right: 0cm; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US"> </span><span lang="EN-US"> </span><span style="font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">last_id = last_id +1</span><o:p></o:p></p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span lang="EN-US">_______________________________________________<br>Qgis-user mailing list<br></span><a href="mailto:Qgis-user@lists.osgeo.org" style="color: purple; text-decoration: underline;"><span lang="EN-US">Qgis-user@lists.osgeo.org</span></a><span lang="EN-US"><br></span><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" style="color: purple; text-decoration: underline;"><span lang="EN-US">http://lists.osgeo.org/mailman/listinfo/qgis-user</span></a></div></div></div></div></div></blockquote></div><br></div></div></body></html>