Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

If we want to get information about a vector layer (shapefile for example) we could use ogrinfo:

ogrinfo -so myshapefile.shp mylayer

This returns a lot of pertinent information about the shapefile. Is it possible to return whether or not a spatial index exists? If so, can we access info about the spatial index?

Note: I realize it is trivial to open the folder containing the shapefile and looking for a .sbn or .sbx and so the question is specific to ogrinfo.

share|improve this question
add comment

1 Answer

Ogr does not use the ESRI spatial Index files .sbn, sbx. It creates a .qix file which may contain a spatial index and/or an attribute index. You can build the .qix via ogrinfo.
Ogr shapefile driver

I also found a GDAL ticket mentioning .sbn file is now readable. Not sure what this means.
ticket #4719

share|improve this answer
2  
"Starting with OGR 1.10, [the ESRI Shapefile driver] can also use the ESRI spatial index files (.sbn / .sbx)" gdal.org/ogr/drv_shapefile.html –  Mike T Mar 6 '13 at 22:32
    
@MikeToews Looks like I had better upgrade. Thanks! –  Jay Laura Mar 7 '13 at 3:06
    
@JayLaura 1.10 is not released yet, but I'm certain the developers would love to have it tested –  Mike T Mar 7 '13 at 3:31
1  
GDAL/OGR 1.10.0 came out last week: trac.osgeo.org/gdal/wiki/Release/1.10.0-News –  kyle May 6 '13 at 21:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.