Skip to content

Commit

Permalink
is_in: Remove duplicate lat/lon entries
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm committed Sep 4, 2024
1 parent a20352e commit 1fceaad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/overpass_api/statements/coord_query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@ void Coord_Query_Statement::execute(Resource_Manager& rman)
}
}

// Remove duplicate lat/lon entries
for (auto& coord : coord_per_req) {
auto& coords_vec = coord.second;

if (!std::is_sorted(coords_vec.begin(), coords_vec.end())) {
std::sort(coords_vec.begin(), coords_vec.end());
}
coords_vec.erase(std::unique(coords_vec.begin(), coords_vec.end()), coords_vec.end());
}

std::map< std::pair< double, double >, std::map< Area::Id_Type, int > > areas_inside;
std::set< Area::Id_Type > areas_found;

Expand Down

0 comments on commit 1fceaad

Please sign in to comment.