| 1 | '''Procedure to create indexes for shapefiles on DOS shell'''[[BR]] |
| 2 | |
| 3 | I often need to create indexes for shapefiles. The shapefiles are on remote disc and are on many gerarchical folders[[BR]] |
| 4 | So I use this simply but surely useful procedure to create the indexes using a dos shell. |
| 5 | |
| 6 | ---- |
| 7 | Suppose the path to the root filder of shapefile is:[[BR]] |
| 8 | |
| 9 | F:\folder1\folder2[[BR]] |
| 10 | |
| 11 | you must run this simply script from a shell dos.[[BR]] |
| 12 | |
| 13 | {{{ |
| 14 | for /R F:\folder1\folder2 %f IN (*.shp) do ogrinfo.exe -sql "CREATE SPATIAL INDEX ON %~nf" %f |
| 15 | }}} |
| 16 | |
| 17 | The script start from F:\folder1\folder2 and recurse on all the folder creating the index for every shapefile found and creating shapefile index. |
| 18 | |
| 19 | Happy indexing. |
| 20 | |
| 21 | Andrea Peri. |
| 22 | |
| 23 | |