<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 10:56 AM, Etienne Tourigny <span dir="ltr"><<a href="mailto:etourigny.dev@gmail.com" target="_blank">etourigny.dev@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">That's a python plugin (ftools), so it may not be available to everyone. <div>
<br></div><div>Better to do it natively (in the data provider) doing something like <span style="font-size:12px;background-color:rgb(251,252,253);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif"> </span>OGR_DS_ExecuteSQL("<span style>CREATE SPATIAL INDEX ON tablename [DEPTH N]</span>") - untested</div>
</div></blockquote><div><br></div><div>there is already a function QgsOgrProvider::createSpatialIndex() (for shapefiles only) which  is called by QgsOgrProvider::syncToDisc() if the spatial index already exists.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
<div><br></div><div>I think it's a great idea to do this automatically with large ogr data sources</div><div><br></div><div>as you said you should probably ask the gdal-dev list about which drivers support spatial index creation an automatic update.</div>

<div><br></div><div>cheers</div><span class=""><font color="#888888"><div>Etienne</div></font></span></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Thu, Feb 27, 2014 at 7:51 AM, kimaidou <span dir="ltr"><<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi<br><div>
<div class="gmail_extra"><br><div class="gmail_quote">2014-02-27 11:14 GMT+01:00 Andrea Peri <span dir="ltr"><<a href="mailto:aperi2007@gmail.com" target="_blank">aperi2007@gmail.com</a>></span>:<div>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>I guess more better is to use this extremely simple batch and create all the index in one step only.<br>
sing the gdal/ogr from osgeo4w.<br>

<br><a href="http://trac.osgeo.org/gdal/wiki/BatchCreationIndexesForShapefilesOnDOS" target="_blank">http://trac.osgeo.org/gdal/wiki/BatchCreationIndexesForShapefilesOnDOS</a><br>
<br></div>Regards,<br></div><br></blockquote><div><br><br></div></div><div> As I said, I am thinking of non power users. They surely won't create nor use such a batch file, even if it is simple. I know there is also the great tool Vector / Data management tools / Create Spatial Index, which can create one for all layers in one step. But users do not use it : they do no know it exists, or they know but forget to use it.<br>


</div></div><br></div></div></div>
<br></div></div><div class="">_______________________________________________<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></div></blockquote></div><br></div>
</blockquote></div><br></div></div>