Skip to content

Commit 1fceaad

Browse files
committedSep 4, 2024·
is_in: Remove duplicate lat/lon entries
1 parent a20352e commit 1fceaad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/overpass_api/statements/coord_query.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,16 @@ void Coord_Query_Statement::execute(Resource_Manager& rman)
267267
}
268268
}
269269

270+
// Remove duplicate lat/lon entries
271+
for (auto& coord : coord_per_req) {
272+
auto& coords_vec = coord.second;
273+
274+
if (!std::is_sorted(coords_vec.begin(), coords_vec.end())) {
275+
std::sort(coords_vec.begin(), coords_vec.end());
276+
}
277+
coords_vec.erase(std::unique(coords_vec.begin(), coords_vec.end()), coords_vec.end());
278+
}
279+
270280
std::map< std::pair< double, double >, std::map< Area::Id_Type, int > > areas_inside;
271281
std::set< Area::Id_Type > areas_found;
272282

0 commit comments

Comments
 (0)
Please sign in to comment.