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_barrier // TODO
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.
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 (has flat top)</string>
matkoniecz marked this conversation as resolved.
Show resolved Hide resolved
<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>