Skip to content

Commit

Permalink
only show bollard quest for bollards on roads (fixes #3017)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Jul 5, 2021
1 parent dbfe44e commit 267ee3b
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ class AddBollardType : OsmElementQuestType<BollardType> {

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"
Expand All @@ -26,7 +32,7 @@ class AddBollardType : OsmElementQuestType<BollardType> {
override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable<Element> {
val wayNodeIds = mutableSetOf<Long>()
mapData.ways
.filter { it.tags["area"] != "yes" }
.filter { waysFilter.matches(it) }
.flatMapTo(wayNodeIds) { it.nodeIds }

return mapData.nodes
Expand Down

0 comments on commit 267ee3b

Please sign in to comment.