Skip to content

Commit

Permalink
mitigate #3797
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Feb 23, 2022
1 parent f45fdff commit 0c541fc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class RoadNameSuggestionsSource(
fun getNames(points: List<LatLon>, maxDistance: Double): List<MutableMap<String, String>> {
if (points.isEmpty()) return emptyList()

val bbox = points.enclosingBoundingBox().enlargedBy(maxDistance)
/* add 50m radius for bbox query because roads will only be included in the result that have
at least one node in the bounding box around the tap position. This is a problem for long
straight roads (#3797). This doesn't completely solve this issue but mitigates it */
val bbox = points.enclosingBoundingBox().enlargedBy(maxDistance + 50)
val mapData = mapDataSource.getMapDataWithGeometry(bbox)
val roadsWithNames = mapData.ways.filter { it.isRoadWithName() }

Expand Down

0 comments on commit 0c541fc

Please sign in to comment.