Skip to content

Commit

Permalink
add support for highway=busway (fixes #5749)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Aug 14, 2024
1 parent bc8fc79 commit ddfce5b
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.westnordost.streetcomplete.osm

val ALL_ROADS = setOf(
"motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link",
"secondary", "secondary_link", "tertiary", "tertiary_link",
"motorway", "motorway_link", "trunk", "trunk_link",
"primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link",
"unclassified", "residential", "living_street", "pedestrian",
"service", "track", "road"
"service", "track", "busway", "road",
)

val ALL_PATHS = setOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fun guessRoadwayWidth(tags: Map<String, String>): Float {
"motorway" -> 2 * BROAD_LANE
"motorway_link" -> BROAD_LANE
"trunk", "primary" -> BROAD_LANE // to pay respect to that primary roads are usually broader than secondary etc
"secondary", "tertiary", "unclassified" -> LANE
"secondary", "tertiary", "unclassified", "busway" -> LANE
"service" -> 2.5f
else -> LANE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private fun getStreetCyclewayStyle(element: Element, countryInfo: CountryInfo):

private val cyclewayTaggingNotExpectedFilter by lazy { """
ways with
highway ~ track|living_street|pedestrian|service|motorway_link|motorway
highway ~ track|living_street|pedestrian|service|motorway_link|motorway|busway
or motorroad = yes
or expressway = yes
or maxspeed <= 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private fun getSidewalkStyle(element: Element): PolylineStyle {

private val sidewalkTaggingNotExpectedFilter by lazy { """
ways with
highway ~ living_street|pedestrian|service|motorway_link
highway ~ living_street|pedestrian|service|motorway_link|busway
or motorroad = yes
or expressway = yes
or maxspeed <= 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AddCrossing : OsmElementQuestType<CrossingAnswer> {

private val roadsFilter by lazy { """
ways with
highway ~ trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential
highway ~ trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|busway
and area != yes
and (access !~ private|no or (foot and foot !~ private|no))
""".toElementFilterExpression() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AddCycleway(
// streets that may have cycleway tagging
private val roadsFilter by lazy { """
ways with
highway ~ primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service
highway ~ primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|busway
and area != yes
and motorroad != yes
and expressway != yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AddLanes : OsmFilterQuestType<LanesAnswer>() {
private val ROADS_WITH_LANES = listOf(
"motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link",
"secondary", "secondary_link", "tertiary", "tertiary_link",
"unclassified"
"unclassified", "busway",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AddMaxHeight : OsmElementQuestType<MaxHeightAnswer> {
private val roadsWithoutMaxHeightFilter by lazy { """
ways with
(
highway ~ motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|living_street|track|road
highway ~ motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|living_street|track|road|busway
or (highway = service and access !~ private|no and vehicle !~ private|no)
)
and $noMaxHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AddMaxSpeed : OsmFilterQuestType<MaxSpeedAnswer>() {

override val elementFilter = """
ways with
highway ~ motorway|trunk|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential
highway ~ motorway|trunk|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|busway
and !maxspeed and !maxspeed:advisory and !maxspeed:forward and !maxspeed:backward
and ${MAXSPEED_TYPE_KEYS.joinToString(" and ") { "!$it" }}
and surface !~ ${UNPAVED_SURFACES.joinToString("|")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AddMaxWeight : OsmFilterQuestType<MaxWeightAnswer>() {

override val elementFilter = """
ways with
highway ~ trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|living_street|service
highway ~ trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|living_street|service|busway
and bridge and bridge != no
and service != driveway
and !maxweight and maxweight:signed != no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AddOneway : OsmElementQuestType<OnewayAnswer> {

/** find only those roads eligible for asking for oneway */
private val elementFilter by lazy { """
ways with highway ~ living_street|residential|service|tertiary|unclassified
ways with highway ~ living_street|residential|service|tertiary|unclassified|busway
and width <= 4 and (!lanes or lanes <= 1)
and !oneway and area != yes and junction != roundabout
and (access !~ private|no or (foot and foot !~ private|no))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AddRoadName : OsmFilterQuestType<RoadNameAnswer>() {

override val elementFilter = """
ways with
highway ~ primary|secondary|tertiary|unclassified|residential|living_street|pedestrian
highway ~ primary|secondary|tertiary|unclassified|residential|living_street|pedestrian|busway
and !name and !name:left and !name:right
and !ref
and noname != yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ private val roadsFilter by lazy { """
ways with
(
(
highway ~ trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service
highway ~ trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|busway
and motorroad != yes
and expressway != yes
and foot != no
)
or
(
highway ~ motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service
highway ~ motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|busway
and (foot ~ yes|designated or bicycle ~ yes|designated)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ val SURFACES_FOR_SMOOTHNESS = listOf(
private val ROADS_TO_ASK_SMOOTHNESS_FOR = arrayOf(
// "trunk","trunk_link","motorway","motorway_link", // too much, motorways are almost by definition smooth asphalt (or concrete)
"primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link",
"unclassified", "residential", "living_street", "pedestrian", "track",
// "service", // this is too much, and the information value is very low
"unclassified", "residential", "living_street", "pedestrian", "track", "busway",
// "service", // this is too much (e.g. includes driveways), and the information value is very low
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AddRoadSurface : OsmFilterQuestType<SurfaceAndNote>() {
ways with (
highway ~ ${listOf(
"primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link",
"unclassified", "residential", "living_street", "pedestrian", "track",
"unclassified", "residential", "living_street", "pedestrian", "track", "busway",
).joinToString("|")
}
or highway = service and service !~ driveway|slipway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AddSidewalkSurface : OsmFilterQuestType<SidewalkSurfaceAnswer>() {
// Only roads with 'complete' sidewalk tagging (at least one side has sidewalk, other side specified)
override val elementFilter = """
ways with
highway ~ motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street
highway ~ motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street|busway
and area != yes
and (
sidewalk ~ both|left|right or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class AddWayLit : OsmFilterQuestType<WayLitOrIsStepsAnswer>() {
}

companion object {
private val LIT_RESIDENTIAL_ROADS = arrayOf("residential", "living_street", "pedestrian")
private val LIT_RESIDENTIAL_ROADS = arrayOf(
"residential", "living_street", "pedestrian", "busway"
)

private val LIT_NON_RESIDENTIAL_ROADS = arrayOf(
"motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AddRoadWidth(
private val wayFilter by lazy { """
ways with (
(
highway ~ trunk|primary|secondary|tertiary|unclassified|residential
highway ~ trunk|primary|secondary|tertiary|unclassified|residential|busway
and (lane_markings = no or lanes < 2)
) or (
highway = residential
Expand Down

0 comments on commit ddfce5b

Please sign in to comment.