On Thu, Feb 27, 2014 at 10:56 AM, Etienne Tourigny <etourigny....@gmail.com>wrote:
> That's a python plugin (ftools), so it may not be available to everyone. > > Better to do it natively (in the data provider) doing something like > OGR_DS_ExecuteSQL("CREATE SPATIAL INDEX ON tablename [DEPTH N]") - > untested > there is already a function QgsOgrProvider::createSpatialIndex() (for shapefiles only) which is called by QgsOgrProvider::syncToDisc() if the spatial index already exists. > > I think it's a great idea to do this automatically with large ogr data > sources > > as you said you should probably ask the gdal-dev list about which drivers > support spatial index creation an automatic update. > > cheers > Etienne > > > On Thu, Feb 27, 2014 at 7:51 AM, kimaidou <kimai...@gmail.com> wrote: > >> Hi >> >> 2014-02-27 11:14 GMT+01:00 Andrea Peri <aperi2...@gmail.com>: >> >> I guess more better is to use this extremely simple batch and create all >>> the index in one step only. >>> sing the gdal/ogr from osgeo4w. >>> >>> http://trac.osgeo.org/gdal/wiki/BatchCreationIndexesForShapefilesOnDOS >>> >>> Regards, >>> >>> >> >> 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. >> >> >> _______________________________________________ >> Qgis-developer mailing list >> Qgis-developer@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/qgis-developer >> > >
_______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer