Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic calming, fixes #2742 #3380

Merged
merged 13 commits into from
Oct 15, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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 @@ -229,6 +230,7 @@ import javax.inject.Singleton
AddTrafficSignalsButton(),

/* ↓ 2.solvable when right in front of it ----------------------------------------------- */
AddTrafficCalmingType(),
matkoniecz marked this conversation as resolved.
Show resolved Hide resolved

AddInformationToTourism(), // OSM Carto

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_traffic_calming
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 @@ -166,6 +166,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.
19 changes: 19 additions & 0 deletions app/src/main/res/drawable/ic_quest_traffic_calming.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128.02dp"
android:height="128.02dp"
android:viewportWidth="128.02"
android:viewportHeight="128.02">
<path
android:pathData="m119.44,96.011c-17.673,30.611 -56.815,41.099 -87.426,23.426 -30.611,-17.673 -41.099,-56.815 -23.426,-87.426 17.673,-30.611 56.815,-41.099 87.426,-23.426 30.611,17.673 41.099,56.815 23.426,87.426"
android:strokeWidth=".2"
android:fillColor="#fd5"/>
<path
android:pathData="m84.139,54.09c-4.761,-6.063 -12.315,-9.659 -20.699,-9.659 -8.488,0 -15.938,3.904 -20.803,10.069 -3.829,4.418 -9.418,7.705 -15.732,7.705H16.349v8.115L111.569,70.217 111.671,61.589H99.872c-6.315,-0.002 -12.007,-3.082 -15.732,-7.499z"
android:strokeWidth="1.96164"
android:fillColor="#120c0e"/>
<path
android:fillColor="#FF000000"
android:pathData="m84.139,62.205c-4.761,-6.063 -12.315,-9.659 -20.699,-9.659 -8.488,0 -15.938,3.904 -20.803,10.069 -3.829,4.418 -9.418,7.705 -15.732,7.705H16.349v8.115l95.22,-0.104 0.102,-8.627H99.872c-6.315,-0.002 -12.007,-3.082 -15.732,-7.499z"
android:strokeWidth="1.96164"
android:fillAlpha="0.2"/>
</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 @@ -1085,4 +1085,13 @@ 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 (narrower)</string>
<string name="quest_traffic_calming_type_hump">Hump (wider)</string>
matkoniecz marked this conversation as resolved.
Show resolved Hide resolved
<string name="quest_traffic_calming_type_table">Table (flat top)</string>
<string name="quest_traffic_calming_type_cushion">Cushion (free pass for buses)</string>
matkoniecz marked this conversation as resolved.
Show resolved Hide resolved
<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>
</resources>
1 change: 1 addition & 0 deletions res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ achievements graphics/
regular Judith Gastell, License: CC-BY-SA 4.0
surveyor mashup with https://wiki.openstreetmap.org/wiki/File:Public-images-osm_logo.svg
(c) 2011 Ken Vermette, License: CC-BY.SA 3.0
traffic_calming mashup with https://commons.wikimedia.org/wiki/File:Belgian_road_sign_A14.svg (License: PD)
tourist Judith Gastell, License: CC-BY-SA 4.0
veg Florian Edelmann; mashup with
https://github.com/twitter/twemoji/blob/v13.0.1/assets/svg/1f955.svg (License: CC-BY 4.0)
Expand Down
47 changes: 47 additions & 0 deletions res/graphics/quest icons/traffic_calming.svg