From 30e8080ef5206266206690716e8ada4a4e945f4e Mon Sep 17 00:00:00 2001 From: landry Date: Sat, 25 Oct 2025 09:56:05 +0000 Subject: [PATCH] geo/spatialite: fix neighbour calculation in qgis reverts a commit from 2.1, see https://github.com/libspatialindex/libspatialindex/issues/276 --- geo/spatialindex/Makefile | 1 + geo/spatialindex/patches/patch-src_rtree_RTree_cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 geo/spatialindex/patches/patch-src_rtree_RTree_cc diff --git a/geo/spatialindex/Makefile b/geo/spatialindex/Makefile index 1b75b4a423f..65f83b24ba9 100644 --- a/geo/spatialindex/Makefile +++ b/geo/spatialindex/Makefile @@ -2,6 +2,7 @@ BROKEN-sparc64 = error: 'raise' was not declared in this scope COMMENT = library for spatial indexing and querying V = 2.1.0 +REVISION = 0 DISTNAME = spatialindex-src-${V} PKGNAME = ${DISTNAME:S/-src//} CATEGORIES = geo diff --git a/geo/spatialindex/patches/patch-src_rtree_RTree_cc b/geo/spatialindex/patches/patch-src_rtree_RTree_cc new file mode 100644 index 00000000000..cb898abf1b9 --- /dev/null +++ b/geo/spatialindex/patches/patch-src_rtree_RTree_cc @@ -0,0 +1,14 @@ +https://github.com/libspatialindex/libspatialindex/pull/277 + +Index: src/rtree/RTree.cc +--- src/rtree/RTree.cc.orig ++++ src/rtree/RTree.cc +@@ -613,7 +613,7 @@ double SpatialIndex::RTree::RTree::nearestNeighborQuer + Data* e = new Data(n->m_pDataLength[cChild], n->m_pData[cChild], *(n->m_ptrMBR[cChild]), n->m_pIdentifier[cChild]); + // we need to compare the query with the actual data entry here, so we call the + // appropriate getMinimumDistance method of NearestNeighborComparator. +- queue.push(NNEntry(n->m_pIdentifier[cChild], e, nnc.getMinimumDistance(query, e->m_region))); ++ queue.push(NNEntry(n->m_pIdentifier[cChild], e, nnc.getMinimumDistance(query, *e))); + } + else + {