<div dir="ltr">Hi list,<div><br></div><div>While tracking down the failures from <a href="https://github.com/qgis/QGIS/pull/63180">https://github.com/qgis/QGIS/pull/63180</a>, it's revealed that using QGIS with libspatialindex >= 2.0 gives completely misleading results for nearest neighbour geometry searches.</div><div><br></div><div>The root cause is an optimisation from the upstream library (<a href="https://github.com/libspatialindex/libspatialindex/commit/6fe9ff769243579ed74f7f27409dd1dda6591634">https://github.com/libspatialindex/libspatialindex/commit/6fe9ff769243579ed74f7f27409dd1dda6591634</a>) that breaks how downstream clients could previously implement custom nearest neighbour comparators. From my research I don't think this is fixable in QGIS, and will need an upstream fix.</div><div><br></div><div>In the meantime, any QGIS build with libspatialindex >= 2 will be silently broken and give COMPLETELY INCORRECT results for anything based on a nearest neighbour query. </div><div><br></div><div>This also affects downstream clients like QField/mergin. </div><div><br></div><div>Do NOT use in production -- you have been warned!!</div><div><br></div><div>Nyall</div><div><br></div></div>