[QGIS-Developer] QgsSpatialIndex nearestNeighbor returns more than 1 feature

Nyall Dawson nyall.dawson at gmail.com
Wed Apr 28 18:14:17 PDT 2021


On Thu, 29 Apr 2021 at 01:55, matteo <matteo.ghetta at gmail.com> wrote:
>
> Hi all,
>
> Using nearestNeighbor of QgsSpatialIndex, even with the flag
> FlagStoreFeatureGeometries, sometimes I got more than 1 feature related
> (distance between the features is not the same, I've manually checked).
>
> Is there a way to return only the nearest feature?

This definitely isn't the correct behaviour --- can you share a sample
which reproduces this issue?

Nyall


More information about the QGIS-Developer mailing list