I am just wondering if one could use the following in a spatial index created 
from the layer provider 

 QgsVectorLayer* cvertexLayer = cVertexLayer(txtStream);
 QgsVectorDataProvider* cvectorProvider = cvertexLayer->dataProvider();
 bool blnSpatialIdx = cvectorProvider->createSpatialIndex();
 
After creating the spatial index file how can I access it in code? 
can I use it in anyway to perform spatial filters for selection purposes?

 QgsSpatialIndex mSpatialIndex = <dynamic_Cast> cvectorProvider; // may be 
cvectorLayer; 

or may be even directly perform this 

 QgsSpatialIndex mSpatialIndex = cvectorProvider->createSpatialIndex();

 // and then do something like this
 mSpatialIndex.intersects( rect ); 


DO I have to create my own in memory spatial index to perform the above 

what do you think? 

Maaza


_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to