<div class="gmail_quote">2010/12/20 Martin Dobias <span dir="ltr">&lt;<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, Dec 20, 2010 at 4:36 PM, Alessandro Pasotti &lt;<a href="mailto:apasotti@gmail.com">apasotti@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; It seems that the segfault happens in the python finalization code.<br>
&gt;&gt; Such crashes happen if the qt objects are deleted in wrong order.<br>
&gt;&gt; Presumably the QApplication object has been deleted earlier than the<br>
&gt;&gt; composition. That could be solved by various ways, for example,<br>
&gt;&gt; delete the composition at the end or set QApplication to be parent of<br>
&gt;&gt; the composition.<br>
&gt;&gt;<br>
&gt;&gt; Since the code crashes in the finalization stage, you should get the<br>
&gt;&gt; output png file anyway. Can you please check?<br>
&gt;<br>
&gt; Yes, the out.png is there but it contains a blank (white) image.<br>
<br>
</div>Looking at the code, I see that you create an instance of<br>
QgsMapRenderer, but do not initialize. You should call its<br>
setLayerSet() and setExtent() methods so that it knows what to render.<br></blockquote><div><br></div><div>Yes you&#39;re right, I did too much cut-n-paste, just added:</div><div><br></div><div><div>lst = [ vlayer.getLayerID() ]</div>
<div>mapRenderer.setLayerSet(lst)</div><div>rect = core.QgsRectangle(mapRenderer.fullExtent())</div><div>rect.scale(0.8)</div><div>mapRenderer.setExtent(rect)</div></div><div><br></div><div><br></div><div>and now the image shows the map correctly.... but it still segfaults.</div>
<div><br></div><div>Dou you think is it also possible (always from a standalone script) to load a map composer template and a qgis project from their XML files?</div></div><div><br></div><br>-- <br>Alessandro Pasotti<br>w3:   <a href="http://www.itopen.it">www.itopen.it</a><br>