From 267ee3b39ab285384ef0c1b93f0a0d788a5b715f Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Mon, 5 Jul 2021 17:52:29 +0200 Subject: [PATCH] only show bollard quest for bollards on roads (fixes #3017) --- .../quests/bollard_type/AddBollardType.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/bollard_type/AddBollardType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/bollard_type/AddBollardType.kt index e2d3d46285..440367f2fc 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/bollard_type/AddBollardType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/bollard_type/AddBollardType.kt @@ -11,8 +11,14 @@ class AddBollardType : OsmElementQuestType { private val bollardNodeFilter by lazy { """ nodes with - barrier = bollard - and !bollard + barrier = bollard + and !bollard + """.toElementFilterExpression() } + + private val waysFilter by lazy { """ + ways with + highway and highway != construction + and area != yes """.toElementFilterExpression() } override val commitMessage = "Add bollard type" @@ -26,7 +32,7 @@ class AddBollardType : OsmElementQuestType { override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable { val wayNodeIds = mutableSetOf() mapData.ways - .filter { it.tags["area"] != "yes" } + .filter { waysFilter.matches(it) } .flatMapTo(wayNodeIds) { it.nodeIds } return mapData.nodes