Skip to content

Commit

Permalink
Merge pull request #3380 from matkoniecz/traffic_calming
Browse files Browse the repository at this point in the history
Traffic calming, fixes #2742
  • Loading branch information
westnordost authored Oct 15, 2021
2 parents 1ff2514 + 5cc89e3 commit a60298c
Show file tree
Hide file tree
Showing 39 changed files with 129 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import de.westnordost.streetcomplete.quests.opening_hours.AddOpeningHours
import de.westnordost.streetcomplete.quests.atm_operator.AddAtmOperator
import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierType
import de.westnordost.streetcomplete.quests.barrier_type.AddStileType
import de.westnordost.streetcomplete.quests.barrier_type.AddTrafficCalmingType
import de.westnordost.streetcomplete.quests.bollard_type.AddBollardType
import de.westnordost.streetcomplete.quests.bus_stop_bin.AddBinStatusOnBusStop
import de.westnordost.streetcomplete.quests.camera_type.AddCameraType
Expand Down Expand Up @@ -190,6 +191,8 @@ import javax.inject.Singleton
AddParkingAccess(), // used by OSM Carto, mapy.cz, OSMand, Sputnik etc
AddParkingFee(), // used by OsmAnd

AddTrafficCalmingType(),

// steps
AddHandrail(), // for accessibility of pedestrian routing, can be gathered when walking past
AddStepsRamp(),
Expand Down Expand Up @@ -230,7 +233,6 @@ import javax.inject.Singleton
AddTrafficSignalsButton(),

/* ↓ 2.solvable when right in front of it ----------------------------------------------- */

AddInformationToTourism(), // OSM Carto

AddPoliceType(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.westnordost.streetcomplete.quests.barrier_type

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.PEDESTRIAN
import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.CAR
import de.westnordost.streetcomplete.quests.traffic_calming_type.AddTrafficCalmingTypeForm
import de.westnordost.streetcomplete.quests.traffic_calming_type.TrafficCalmingType

class AddTrafficCalmingType : OsmFilterQuestType<TrafficCalmingType>() {

override val elementFilter = """
nodes with traffic_calming=yes
"""
override val commitMessage = "Add specific traffic calming type on a point"
override val wikiLink = "Key:traffic_calming"
override val icon = R.drawable.ic_quest_car_bumpy
override val isDeleteElementEnabled = true

override fun getTitle(tags: Map<String, String>) = R.string.quest_traffic_calming_type_title

override fun createForm() = AddTrafficCalmingTypeForm()

override fun applyAnswerTo(answer: TrafficCalmingType, changes: StringMapChangesBuilder) {
changes.modify("traffic_calming", answer.osmValue)
}

override val questTypeAchievements = listOf(PEDESTRIAN, CAR)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package de.westnordost.streetcomplete.quests.traffic_calming_type

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AImageListQuestAnswerFragment
import de.westnordost.streetcomplete.quests.traffic_calming_type.TrafficCalmingType
import de.westnordost.streetcomplete.quests.traffic_calming_type.TrafficCalmingType.*
import de.westnordost.streetcomplete.view.image_select.Item

class AddTrafficCalmingTypeForm : AImageListQuestAnswerFragment<TrafficCalmingType, TrafficCalmingType>() {

override val items = listOf(
Item(BUMP, R.drawable.traffic_calming_bump, R.string.quest_traffic_calming_type_bump),
Item(HUMP, R.drawable.traffic_calming_hump, R.string.quest_traffic_calming_type_hump),
Item(TABLE, R.drawable.traffic_calming_table, R.string.quest_traffic_calming_type_table),
Item(CUSHION, R.drawable.traffic_calming_cushion, R.string.quest_traffic_calming_type_cushion),
Item(ISLAND, R.drawable.traffic_calming_island, R.string.quest_traffic_calming_type_island),
Item(CHOKER, R.drawable.traffic_calming_choker, R.string.quest_traffic_calming_type_choker),
Item(CHICANE, R.drawable.traffic_calming_chicane, R.string.quest_traffic_calming_type_chicane),
Item(RUMBLE_STRIP, R.drawable.traffic_calming_rumble_strip, R.string.quest_traffic_calming_type_rumble_strip),
)

override val itemsPerRow = 3

override fun onClickOk(selectedItems: List<TrafficCalmingType>) {
applyAnswer(selectedItems.single())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.westnordost.streetcomplete.quests.traffic_calming_type

enum class TrafficCalmingType(val osmValue: String) {
BUMP("bump"),
HUMP("hump"),
TABLE("table"),
CUSHION("cushion"),
ISLAND("island"),
CHOKER("choker"),
CHICANE("chicane"),
RUMBLE_STRIP("rumble_strip"),
}
10 changes: 10 additions & 0 deletions app/src/main/res/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ tactile_paving_illustration... CC-BY 2.0 https://www.flickr.com/photos/j
CC-BY 2.0 https://www.flickr.com/photos/jeanlouis_zimmermann/10493532264/in/album-72157635218804514/
CC-BY 2.0 https://www.flickr.com/photos/jeanlouis_zimmermann/10473021344/in/album-72157635218804514/

traffic_calming_bump.jpg PD Goldfinger https://commons.wikimedia.org/wiki/File%3ALe%C5%BEe%C4%87i%5Fpolicajac%5F016%2Ejpg
traffic_calming_chicane.jpg CC-BY-SA 2.0 Richard Drdul https://commons.wikimedia.org/wiki/File:One-lane_chicane_1.jpg
traffic_calming_choker.jpg CC-BY-SA 2.0 Mike Faherty https://www.geograph.ie/photo/2350574
traffic_calming_cushion.jpg CC-BY-SA 2.0 Zorro2212 https://commons.wikimedia.org/wiki/File%3ASpeed%5Fcushion%5F%2D%5Fberliner%5Fpillow%2C%5F%C5%81%C3%B3d%C5%BA%5FKarolewska%5FStreet%5F2015%5F02%2Ejpg
traffic_calming_hump.jpg CC-BY-SA 3.0 Petr Vilgus https://commons.wikimedia.org/wiki/File:Horn%C3%AD_Po%C4%8Dernice_zpomalovac%C3%AD_pruh.JPG
traffic_calming_island.jpg PD MetiorErgoSum https://wiki.openstreetmap.org/wiki/File:Trafficcalming-island.jpg
traffic_calming_ruble_strip... CC-BY-SA 3.0 Koolah https://commons.wikimedia.org/wiki/File%3AZebra%5Fzone%5Fat%5Firiomote%2Ejpg
traffic_calming_table.jpg CC-BY-SA 2.5 noebse https://commons.wikimedia.org/wiki/File%3ABremsschwelle%2EJPG


tracktype_grade1.jpg Public Domain https://github.com/westnordost/StreetComplete/pull/959#issuecomment-427905219 (Bjorn Rasmussen)
tracktype_grade2.jpg CC-BY 4.0 https://github.com/westnordost/StreetComplete/issues/133#issuecomment-393650654 (Bjorn Rasmussen)
tracktype_grade3.jpg CC-BY-SA 2.0 https://wiki.openstreetmap.org/wiki/File:Tracktype.jpg
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions app/src/main/res/drawable/ic_quest_car_bumpy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
android:pathData="m128,64a64,64 0,0 1,-64 64,64 64,0 0,1 -64,-64 64,64 0,0 1,64 -64,64 64,0 0,1 64,64"
android:fillColor="#fd5"/>
<path
android:fillColor="#FF000000"
android:pathData="m46.295,26.301c-7.502,2.073 -14.858,4.681 -18.848,6.937 -5.683,3.213 -5.286,15.984 -4.674,22.563 -0.566,-0.159 -1.177,-0.182 -1.785,-0.014l-4.286,1.184c-1.777,0.491 -2.819,2.326 -2.328,4.103 0.491,1.777 2.328,2.818 4.105,2.327l2.389,-0.66c-0.612,2.902 0.459,6.795 0.459,6.795l7.7,27.866c0.654,2.366 3.104,3.756 5.47,3.102l6.431,-1.777c2.366,-0.654 3.757,-3.104 3.103,-5.471l-0.239,-0.866c6.056,-0.749 11.63,-2.281 19.531,-4.464 7.902,-2.183 13.47,-3.729 19.052,-6.195l0.239,0.865c0.654,2.366 3.105,3.755 5.472,3.101l6.431,-1.777c2.366,-0.654 3.756,-3.104 3.102,-5.47l-7.7,-27.866c-0.878,-3.177 -2.018,-5.009 -3.107,-6.063l2.401,-0.664c1.775,-0.49 2.818,-2.328 2.327,-4.105 -0.491,-1.777 -2.329,-2.816 -4.104,-2.326l-4.286,1.184c-0.607,0.168 -1.12,0.502 -1.523,0.928 -2.852,-5.961 -9.069,-17.124 -15.597,-16.962 -4.583,0.113 -12.232,1.651 -19.735,3.724z"
android:fillAlpha="0.2"/>
<path
android:pathData="m94.002,61.863 l-12.287,13.984 0.775,2.807c0.654,2.366 3.108,3.755 5.475,3.102l6.428,-1.777c2.366,-0.654 3.757,-3.104 3.103,-5.471l-3.494,-12.645zM24.166,76.314 L28.904,93.46c0.654,2.366 3.106,3.757 5.473,3.103l6.43,-1.777c2.366,-0.654 3.666,-3.081 3.102,-5.471l-0.471,-1.998 -19.271,-11.004z"
android:fillColor="#555"/>
<path
android:pathData="m65.908,18.637c-9.166,0.225 -30.602,6.148 -38.584,10.66 -5.687,3.215 -5.283,15.978 -4.67,22.553 -0.358,-0.101 -0.737,-0.143 -1.121,-0.117 -0.221,0.015 -0.444,0.052 -0.666,0.113l-4.287,1.186c-1.777,0.491 -2.819,2.326 -2.328,4.103 0.491,1.777 2.326,2.817 4.103,2.326l2.391,-0.66c-0.612,2.902 0.459,6.795 0.459,6.795l4.738,17.148s2.05,6.424 10.941,6.205c9.166,-0.226 15.596,-2.001 26.314,-4.963 9.076,-2.415 17.274,-4.818 25.131,-9.25 3.968,-2.409 6.887,-5.943 6.205,-10.945 -1.579,-5.716 -3.159,-11.432 -4.738,-17.148 -0.878,-3.176 -2.019,-5.008 -3.107,-6.063l2.402,-0.664c1.775,-0.49 2.819,-2.327 2.328,-4.103 -0.43,-1.555 -1.892,-2.545 -3.44,-2.44 -0.221,0.015 -0.444,0.052 -0.666,0.113l-4.287,1.184c-0.609,0.168 -1.123,0.503 -1.527,0.932 -2.847,-5.955 -9.055,-17.126 -15.592,-16.965z"
android:fillColor="#3b88c3"/>
<path
android:pathData="m52.54,45.402c8.37,-2.313 18.602,-4.679 26.055,-5.903l-5.438,-11.33c-3.92,-5.838 -16.782,-2.284 -25.355,0.085 -8.574,2.369 -21.435,5.923 -21.802,12.946l1.151,12.515c7.024,-2.776 17.019,-5.999 25.389,-8.312"
android:fillColor="#bbddf5"/>
<path
android:pathData="m81.07,49.365c-0.656,-0.021 -1.325,0.056 -1.99,0.24l-2.145,0.592c-3.55,0.981 -5.634,4.655 -4.652,8.207 0.981,3.552 4.657,5.635 8.207,4.654l2.143,-0.592c3.55,-0.981 5.636,-4.655 4.654,-8.207 -0.797,-2.886 -3.375,-4.804 -6.217,-4.894zM36.058,61.803c-0.656,-0.021 -1.326,0.056 -1.992,0.24l-2.145,0.592c-3.552,0.981 -5.636,4.655 -4.654,8.207 0.981,3.552 4.657,5.636 8.209,4.654l2.143,-0.592c3.552,-0.981 5.636,-4.657 4.654,-8.209 -0.797,-2.886 -3.372,-4.802 -6.215,-4.893z"
android:fillColor="#fff"/>
<path
android:pathData="m79.438,43.629c-5.925,-0.116 -11.322,1.72 -11.646,1.834 -1.155,0.405 -1.772,1.667 -1.369,2.826 0.399,1.161 1.664,1.776 2.824,1.375 0.099,-0.033 9.945,-3.367 16.23,-0.318 0.694,0.338 1.48,0.278 2.1,-0.086 0.364,-0.214 0.673,-0.538 0.873,-0.947 0.536,-1.107 0.076,-2.435 -1.031,-2.971 -2.485,-1.204 -5.287,-1.66 -7.981,-1.713zM39.928,53.238c-0.148,0 -0.298,0.016 -0.449,0.047 -0.491,0.099 -12.056,2.583 -16.902,9.973 -0.673,1.028 -0.387,2.405 0.639,3.08 0.382,0.248 0.812,0.367 1.234,0.363 0.718,-0.006 1.421,-0.358 1.846,-1.004 3.829,-5.843 13.99,-8.035 14.092,-8.059 1.201,-0.252 1.972,-1.43 1.721,-2.631 -0.22,-1.051 -1.143,-1.773 -2.18,-1.77zM70.754,74.138c-2.796,-0.014 -6.234,0.494 -9.859,1.496h-0.002c-8.287,2.29 -14.411,6.289 -13.523,9.504 0.49,1.775 7.014,-0.784 15.301,-3.074 8.287,-2.29 15.199,-3.442 14.709,-5.217 -0.5,-1.809 -3.031,-2.691 -6.625,-2.709z"
android:fillColor="#269"/>
<path
android:pathData="m30.554,80.283c-1.07,-0.607 -1.444,-1.961 -0.837,-3.031 0.533,-0.943 1.651,-1.347 2.644,-1.012 0.557,0.077 5.389,0.424 27.156,-5.591 21.767,-6.015 25.736,-8.793 26.174,-9.145 0.682,-0.797 1.844,-1.024 2.788,-0.489 1.07,0.607 1.444,1.961 0.837,3.031 -1.657,2.922 -16.476,7.536 -28.615,10.89 -12.139,3.354 -27.225,7.004 -30.147,5.347z"
android:fillColor="#55acee"/>
<path
android:fillColor="#FF000000"
android:pathData="m94,88a20,14 0,0 0,-19.793 12h39.586a20,14 0,0 0,-19.793 -12z"
android:fillAlpha="0.2"/>
<path
android:pathData="m94,84a20,14 0,0 0,-19.793 12h39.586a20,14 0,0 0,-19.793 -12z"
android:fillColor="#555"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,15 @@ If you are overwhelmed by the number of quests, you can always fine-tune which q
<string name="quest_presets_selected">Selected</string>
<string name="quest_presets_delete_message">"Delete preset “%s”? The quest selection and order for it will be irrevocably lost."</string>
<string name="quest_picnicTableCover_title">Is this picnic table covered (protected from rain)?</string>
<string name="quest_traffic_calming_type_title">What type of traffic calming is this?</string>
<string name="quest_traffic_calming_type_bump">Bump (shorter)</string>
<string name="quest_traffic_calming_type_hump">Hump (longer)</string>
<string name="quest_traffic_calming_type_table">Table (flat top)</string>
<string name="quest_traffic_calming_type_cushion">Cushion (not bumpy for buses)</string>
<string name="quest_traffic_calming_type_choker">Narrowed road</string>
<string name="quest_traffic_calming_type_island">Island</string>
<string name="quest_traffic_calming_type_chicane">Deliberate curve(s)</string>
<string name="quest_traffic_calming_type_rumble_strip">Rumble strip(s)</string>
<string name="quest_surface_value_concrete_plates">Concrete plates</string>
<string name="quest_surface_value_concrete_lanes">Concrete lanes</string>
<string name="quest_fireHydrant_diameter_title">What diameter is on this fire hydrant’s sign?</string>
Expand Down

0 comments on commit a60298c

Please sign in to comment.