11 Commits

Author SHA1 Message Date
Nyall Dawson
8d6e3dc911 [FEATURE][API] Add method to QgsSpatialIndex to perform
nearest neighbor search based on QgsGeometry to QgsGeometries

Previously only point - geometry was possible. But with this
change, you can safely and accurately use QgsSpatialIndex
to determine the nearest neighbours between any types of
geometries.
2019-04-03 02:31:03 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Bas Couwenberg
371176357b Fix spelling errors.
* cancelation -> cancellation
 * overal      -> overall
2019-02-24 22:39:40 +01:00
Nyall Dawson
c8a4dff475 Add maximum search distance parameter to QgsSpatialIndex::nearestNeighbor 2019-02-20 05:40:02 +10:00
Nyall Dawson
362ba02ade When a QgsSpatialIndex is storing feature geometry, then
nearestNeighbor search performs an EXACT nearest neighbour search,
instead of just a nearest-neighbour-by-bounding-box search
2019-02-20 05:40:02 +10:00
Nyall Dawson
26555358f9 Add API for QgsSpatialIndex to optionally store feature geometries
This potentially avoids a second expensive feature request after
building a spatial index and later needing to re-request features
which match spatial index search.

It's non-default, as it requires the index to store all feature
geometries, so it's more memory expensive.
2019-02-20 05:40:02 +10:00
Peter Petrik
27c670e78d expose mesh spatial index similarly to vector spatial index to API. fix travis issues and documentation 2019-01-24 16:24:46 +01:00
Nyall Dawson
6110931f8a Rename QgsSpatialIndex::insertFeature to ::addFeature, for consistency
with other classes

And make QgsSpatialIndex a QgsFeatureSink
2018-09-29 07:37:53 +10:00
Nyall Dawson
0df1056dd4 [FEATURE] QgsSpatialIndexKDBush
A very fast static spatial index for 2D points based on a flat KD-tree,
using https://github.com/mourner/kdbush.hpp

Compared to QgsSpatialIndex, this index:
 - supports single point features only (no multipoints)
 - is static (features cannot be added or removed from the index after construction)
 - is much faster!
 - supports true "distance based" searches, i.e. return all points within a radius
from a search point
2018-07-07 10:54:47 +10:00
Nyall Dawson
c864d22d1f Add "get ..." to doxygen compliance blacklist
Should be "gets ..." for consistent tense, or better yet
"returns ..." for consistency.
2018-05-27 14:05:06 +10:00
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00