Skip to content

Commit

Permalink
lookup: use more precise rtree query box
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Sep 11, 2024
1 parent 26a6933 commit 767212e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions include/osr/lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ struct lookup {
return way_candidates;
}

template <typename Fn>
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>(fn));
}

template <typename Fn>
void find(geo::box const& b, Fn&& fn) const {
auto const min = b.min_.lnglat();
Expand Down Expand Up @@ -129,7 +123,7 @@ struct lookup {
double const max_match_distance,
bitvec<node_idx_t> const* blocked) const {
auto way_candidates = std::vector<way_candidate>{};
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<way_candidate>(
query.pos_, ways_.way_polylines_[way]);
if (d.dist_to_way_ < max_match_distance) {
Expand Down

0 comments on commit 767212e

Please sign in to comment.