From 767212e24456ad0ba64d8ef45616de8c0e43abf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Wed, 11 Sep 2024 11:36:15 +0200 Subject: [PATCH] lookup: use more precise rtree query box --- include/osr/lookup.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/osr/lookup.h b/include/osr/lookup.h index 7768a19..cb068e6 100644 --- a/include/osr/lookup.h +++ b/include/osr/lookup.h @@ -95,12 +95,6 @@ struct lookup { return way_candidates; } - template - void find(geo::latlng const& x, Fn&& fn) const { - find({{x.lat() - 0.01, x.lng() - 0.01}, {x.lat() + 0.01, x.lng() + 0.01}}, - std::forward(fn)); - } - template void find(geo::box const& b, Fn&& fn) const { auto const min = b.min_.lnglat(); @@ -129,7 +123,7 @@ struct lookup { double const max_match_distance, bitvec const* blocked) const { auto way_candidates = std::vector{}; - find(query.pos_, [&](way_idx_t const way) { + find(geo::box{query.pos_, max_match_distance}, [&](way_idx_t const way) { auto d = geo::distance_to_polyline( query.pos_, ways_.way_polylines_[way]); if (d.dist_to_way_ < max_match_distance) {