gwaldron/osgearth — pull request #498 by aurelien35 (2014-04-15 11:53:05+00:00)
Title: Use OGR api tests spatial index availability before build it. The spatial index is built only if it doesn't exist or if force_rebuild option is ON

I often get messages from OGR like this one in the console : "Failed to delete file xxxyyyzzz.qix. Permission denied"

This happen when an OGR dataset (or more specifically a shapefile) is already opened.

I added a test to build the spatial index only if necessary :
- spatial index is asked but doesn't exists
- spatial index "force_rebuild" is ON

This can also give a little more performances on large shape files, since the spatial index was rebuilt at every "shapefile first open"