The waste of time occurs when you call the add layer methods (either vector or raster) several times and the QGIS canvas is refreshed once by layer, so you can see every layer refreshing the canvas unnecesarily. For me it&#39;s certainly a waste of time. Anyway, QGIS manages this in an appropriate way by providing the setRenderFlag method.<div>

<div><br></div><div>As Santiago proposed, he&#39;d like the Build Virtual Raster tool to take into account files in subdirectories, so you can use some code of the Load Them All plugin to achieve this, particularly the getFilesToLoad method in LoadFiles.py. Of course, you won&#39;t load more than one layer, but anyway you need to look for layers in subdirectories. </div>

<div><br></div><div>I&#39;m just trying to help, if you find my comments causing troubles please ignore them :) </div><div><br></div><div>Regards,</div><div><br></div><div>Germán</div></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 12px; border-collapse: collapse; "><div>

<font class="Apple-style-span" color="#888888"><font class="Apple-style-span" color="#000000"><div><span class="Apple-style-span" style="border-collapse: separate; font-size: small;"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px;"><br>

</span></font></span></div></font></font></div></span><div class="gmail_quote">2010/11/24 Giuseppe Sucameli <span dir="ltr">&lt;<a href="mailto:sucameli@faunalia.it">sucameli@faunalia.it</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Germán,<br><br><div class="gmail_quote">2010/11/25 Germán Carrillo <span dir="ltr">&lt;<a href="mailto:carrillo.german@gmail.com" target="_blank">carrillo.german@gmail.com</a>&gt;</span><div class="im"><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">




<div>I mean, the Load Them All plugin receives a base directory and an extension (e.g. GML) to look for layers in the base directory and in its subdirectories. It also loads those layers to QGIS by managing the canvas setRenderFlag method to avoid an unnecessary waste of time in the process.</div>




</blockquote></div><div>the BuildVRT tool add only one layer to canvas. I unable to find the waste of time <br>in  cases like this.<br><br>Instead managing the render flag would be pretty useful in batch tools (e.g. Translate).<br>



Thanks a lot, I&#39;m going to improve each batch tool by properly disabling/enabling the <br>render flag while it adds layers to canvas.<br><br>Cheers.<br><br></div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">





<div></div><div>Regards, </div><div><br></div><font color="#888888"><div>Germán</div></font><div><div></div><div><div><br><div class="gmail_quote">2010/11/24 Giuseppe Sucameli <span dir="ltr">&lt;<a href="mailto:sucameli@faunalia.it" target="_blank">sucameli@faunalia.it</a>&gt;</span><br>






<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Germán,<br><br><div class="gmail_quote">2010/11/24 Germán Carrillo <span dir="ltr">&lt;<a href="mailto:carrillo.german@gmail.com" target="_blank">carrillo.german@gmail.com</a>&gt;</span><div>






<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">


<div></div><div>I think you may reuse some code of the Load Them All Plugin [1] to accomplish this. </div></blockquote></div><div>what did you mean writing &quot;to accomplish this&quot;, to load the layers or <br>maybe to do a recursive scan?<br>








<br>Cheers.<br><br></div><div><div></div><div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><br></div>
<div>Regards, </div><div><br></div><div>Germán</div><div><br></div><div>-------------------</div>

<div>[1] <a href="http://geotux.tuxfamily.org/index.php?option=com_myblog&amp;task=view&amp;id=264&amp;Itemid=59&amp;lang=en" target="_blank">http://geotux.tuxfamily.org/index.php?option=com_myblog&amp;task=view&amp;id=264&amp;Itemid=59&amp;lang=en</a><br>











<br><div class="gmail_quote">2010/11/24 Giuseppe Sucameli <span dir="ltr">&lt;<a href="mailto:sucameli@faunalia.it" target="_blank">sucameli@faunalia.it</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">









<div><div></div><div>

Hi Santiago, <br><br><div class="gmail_quote"><div>On Wed, Nov 24, 2010 at 6:01 PM, Santiago Lastra <span dir="ltr">&lt;<a href="mailto:santiago.lastra@gmail.com" target="_blank">santiago.lastra@gmail.com</a>&gt;</span> wrote:<br>











<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

<div>Recently I&#39;ve found this very interesting and useful tool, at least for me. I will propose two ways to improve the tool:<br>- The tool right now offers the user the possibility to select as many files as he wants inside a directory. I propose to give also the possibility to define only a directory that contains raster files (of every kind), with a check box to give the oportunity to follow the subdirectories of the first one.<br>













</div></blockquote></div><div>there&#39;s an opened ticket yet, see [1] ;)<br><br></div><div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">







<div>
- I think it&#39;s better to explain my problem and I think you will understand the reason of my second proposal. I have directories with up to 2000 raster files or even more. If you try the tool as is and if you select &quot;add to canvas&quot;, it takes several minutes to load and see the virtual raster catalog (VRT) into QGIS, but if I zoom in to the right scale QGIS move the images very quickly. What I suggest is to add in the dialog the possibility to define the &quot;scale dependent visibility&quot; when the VRT is added to the TOC of QGIS. <br>













</div></blockquote></div>Why don&#39;t you stop the rendering? So you can set the &quot;scale dependent visibility&quot; <br>range using the existent layer properties dialog.<br><br>Simply you can disable it either before you add the layer  or while QGis loads it.<br>













Or maybe did I misunderstand?<br><br>Cheers.<br><br><div>[1] <a href="https://trac.osgeo.org/qgis/ticket/3095" target="_blank">https://trac.osgeo.org/qgis/ticket/3095</a> <br></div></div><br clear="all"><br>-- <br><font color="#888888">Giuseppe Sucameli<br>











<br>


</font><br></div></div>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div>-- <br>-----------<br>  |\__  <br>(:&gt;__)(<br>  |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br>












</div>
<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">Giuseppe Sucameli<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>-----------<br>  |\__  <br>(:&gt;__)(<br>  |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br>







</div>
</div></div><br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">Giuseppe Sucameli<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>-----------<br>  |\__  <br>(:&gt;__)(<br>  |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>


</div>