<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-27 11:08 GMT+01:00 Martin Dobias <span dir="ltr"><<a href="mailto:wonder.sk@gmail.com" target="_blank">wonder.sk@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<div class=""><br>
On Thu, Feb 27, 2014 at 4:47 PM, kimaidou <<a href="mailto:kimaidou@gmail.com">kimaidou@gmail.com</a>> wrote:<br>
> Hi list,<br>
><br>
> I have some concerns about spatial indexes in QGIS. Spatial indexes are very<br>
> usefull, and for me rather mandatory as soon as you deal with more than 100<br>
> features.<br>
><br>
><br>
> I would like to share some ideas about them :<br>
><br>
> 1) Extend QGIS so that it can create spatial indexes for more vector format.<br>
> If I am correct, for now only Shapefiles and Database vector layers can have<br>
> a spatial index created by QGIS . Why not for GeoJson, CSV files, etc ?<br>
<br>
</div>The create spatial index functionality is handled by data provider -<br>
in this case GDAL/OGR - at some point it was available only for<br>
shapefiles, not sure if anything changed since then.<br></blockquote><div><br><br></div><div>Ah, ok, so I should better ask in GDAL lists !<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
<br>
> 2) If possible, create a spatial index for each vector layer added to the<br>
> canvas if no one is already present. Since it is a quite fast operation, the<br>
> small time needed is worth it.<br>
<br>
</div>I am not sure this is the right thing to do it automatically. It could<br>
however suggest it for large layers for better performance.<br></blockquote><div><br><br></div><div>It could be an option, but I did not think it is worth it as the spatial index is fast to create. I agree we could detect if the layer is large and do it only in this case.<br>
</div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
<br>
> 3) If possible, update the spatial index (replace the old qix by a new one)<br>
> every time the vector layer is updated. No need to do so for database<br>
> layers, but this can be very usefull for big shapefiles. I have seen some<br>
> people creating a spatial index, then as time passes, they add more and more<br>
> data into the shapefile but forget to update the spatial index. Sometimes<br>
> this can lead to some data not displayed in QGIS because QGIs seems to rely<br>
> on the outdatedSpatial index.<br>
<br>
</div>Doesn't OGR handle the update of the spatial index automatically?<br></blockquote><div><br><br></div><div>I do not know, I should do some more research... This would be great indeed.<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888">Martin<br>
</font></span></blockquote></div><br></div></div>