|Version 3 (modified by aperi2007, 17 months ago)|
Procedure to create spatial indexes for shapefiles on DOS shell
I often need to create indexes for shapefiles. The shapefiles are on remote disc and are on many gerarchical folders
So I use this simply but surely useful procedure to create the indexes using a dos shell.
Suppose the path to the root filder of shapefile is:
you must run this simply script from a shell dos.
for /R F:\folder1\folder2 %f IN (*.shp) do ogrinfo.exe -sql "CREATE SPATIAL INDEX ON %~nf" %f
The script start from F:\folder1\folder2 and recurse on all the folders creating the spatial index for every shapefile found.