Re: [Qgis-developer] What's the recommended way to implement a spatial index in Processing algorithms?

2016-06-15 Thread Anita Graser
​Hi, On Tue, Jun 14, 2016 at 3:01 PM, Daan Goedkoop wrote: > What I use is: > features = processing.features( layer ) > index = QgsSpatialIndex( features.__iter__() ) Thanks Daan, that looks good! On Wed, Jun 15, 2016 at 12:31 PM, Victor Olaya wrote:

Re: [Qgis-developer] What's the recommended way to implement a spatial index in Processing algorithms?

2016-06-15 Thread Victor Olaya
i guess that the spatial index should be created as usual, but, as you say, only including selected features if the Processing settings is configured to use only those ones. I dont see any specific thing about it being a Processing algorithm, other than that. An even if you create it for the

[Qgis-developer] What's the recommended way to implement a spatial index in Processing algorithms?

2016-06-14 Thread Anita Graser
Hi, Some existing Processing algorithms could be faster by making use of a spatial index, e.g. http://hub.qgis.org/issues/15012 What's the recommended way to implement a spatial index in a processing algorithm to ensure consistent behavior with other tools (e.g. concerning using only selected