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

shelter_type quest #4428

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import de.westnordost.streetcomplete.quests.max_height.AddMaxPhysicalHeight
import de.westnordost.streetcomplete.quests.max_speed.AddMaxSpeed
import de.westnordost.streetcomplete.quests.max_weight.AddMaxWeight
import de.westnordost.streetcomplete.quests.memorial_type.AddMemorialType
import de.westnordost.streetcomplete.quests.shelter_type.AddShelterType
import de.westnordost.streetcomplete.quests.motorcycle_parking_capacity.AddMotorcycleParkingCapacity
import de.westnordost.streetcomplete.quests.motorcycle_parking_cover.AddMotorcycleParkingCover
import de.westnordost.streetcomplete.quests.oneway.AddOneway
Expand Down Expand Up @@ -254,6 +255,7 @@ fun questTypeRegistry(
AddStepsIncline(), // can be gathered while walking perpendicular to the way e.g. the other side of the road or when running/cycling past, confuses some people, so not as high as it theoretically should be

AddMemorialType(), // sometimes a bit hard to decide between the different types (something something sculpture)
AddShelterType(),

AddReligionToPlaceOfWorship(), // icons on maps are different - OSM Carto, mapy.cz, OsmAnd, Sputnik etc
AddReligionToWaysideShrine(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package de.westnordost.streetcomplete.quests.shelter_type

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.CITIZEN
import de.westnordost.streetcomplete.osm.Tags

class AddShelterType : OsmFilterQuestType<ShelterType>() {

override val elementFilter = """
nodes, ways, relations with
amenity=shelter
and !shelter_type
"""
override val changesetComment = "Specify shelter types"
override val wikiLink = "Key:shelter_type"
override val icon = R.drawable.ic_quest_shelter_type
override val isDeleteElementEnabled = true
override val achievements = listOf(EditTypeAchievement.OUTDOORS)

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

override fun createForm() = AddShelterTypeForm()

override fun applyAnswerTo(answer: ShelterType, tags: Tags, timestampEdited: Long) {
answer.applyTo(tags)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package de.westnordost.streetcomplete.quests.shelter_type

import de.westnordost.streetcomplete.quests.AImageListQuestForm

class AddShelterTypeForm : AImageListQuestForm<ShelterType, ShelterType>() {

override val items = ShelterType.values().map { it.asItem() }
override val itemsPerRow = 3

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

import de.westnordost.streetcomplete.osm.Tags

enum class ShelterType(val osmValue: String) {
PUBLIC_TRANSPORT("public_transport"),
PICNIC_SHELTER("picnic_shelter"),
GAZEBO("gazebo"),
WEATHER_SHELTER("weather_shelter"),
LEAN_TO("lean_to"),
PAVILION("pavilion"),
BASIC_HUT("basic_hut"),
SUN_SHELTER("sun_shelter"),
FIELD_SHELTER("field_shelter"),
}

fun ShelterType.applyTo(tags: Tags) {
tags["shelter_type"] = this.osmValue
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package de.westnordost.streetcomplete.quests.shelter_type

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.PUBLIC_TRANSPORT
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.PICNIC_SHELTER
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.GAZEBO
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.WEATHER_SHELTER
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.LEAN_TO
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.PAVILION
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.BASIC_HUT
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.SUN_SHELTER
import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.FIELD_SHELTER
import de.westnordost.streetcomplete.view.image_select.Item

fun ShelterType.asItem() = Item(this, iconResId, titleResId)

private val ShelterType.titleResId: Int get() = when (this) {
PUBLIC_TRANSPORT -> R.string.quest_shelterType_public_transport
PICNIC_SHELTER -> R.string.quest_shelterType_picnic_shelter
GAZEBO -> R.string.quest_shelterType_gazebo
WEATHER_SHELTER -> R.string.quest_shelterType_weather_shelter
LEAN_TO -> R.string.quest_shelterType_lean_to
PAVILION -> R.string.quest_shelterType_pavilion
BASIC_HUT -> R.string.quest_shelterType_basic_hut
SUN_SHELTER -> R.string.quest_shelterType_sun_shelter
FIELD_SHELTER -> R.string.quest_shelterType_field_shelter
}

private val ShelterType.iconResId: Int get() = when (this) {
PUBLIC_TRANSPORT -> R.drawable.shelter_type_public_transport
PICNIC_SHELTER -> R.drawable.shelter_type_picnic_shelter
GAZEBO -> R.drawable.shelter_type_gazebo
WEATHER_SHELTER -> R.drawable.shelter_type_weather_shelter
LEAN_TO -> R.drawable.shelter_type_lean_to
PAVILION -> R.drawable.shelter_type_pavilion
BASIC_HUT -> R.drawable.shelter_type_basic_hut
SUN_SHELTER -> R.drawable.shelter_type_sun_shelter
FIELD_SHELTER -> R.drawable.shelter_type_field_shelter
}
10 changes: 10 additions & 0 deletions app/src/main/res/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ recycling_centre.jpg Public Domain https://commons.wikimedia.org/w
recycling_container.jpg CC0 https://commons.wikimedia.org/wiki/File:Vitoria_-_Contenedores_de_reciclaje_en_la_Avenida_de_Gasteiz.jpg
recycling_container_undergr... CC0 https://commons.wikimedia.org/wiki/File:San_Fernando_de_Henares_-_reciclaje_de_residuos_urbanos_04.JPG

shelter_type_public_transpor… CC-BY-SA 4.0 Silar https://wiki.openstreetmap.org/wiki/File:02019_1048_(2)_Bus_station,_%C5%BBywiecka_street,_Bia%C5%82a.jpg
shelter_type_picnic_shelter.… CC-BY-SA 3.0 B.navez https://wiki.openstreetmap.org/wiki/File:R%C3%A9union_Ma%C3%AFdo_kiosque_pique-nique.JPG
shelter_type_gazebo.jpg CC-BY 4.0 ermell https://wiki.openstreetmap.org/wiki/File:Bamberg-Hain-Pavillion-P1180860.jpg
shelter_type_weather_shelter… Fröstel https://wiki.openstreetmap.org/wiki/File:German-shelter-harz.jpg
shelter_type_lean_to.jpg CC-BY-SA 3.0 Mwanner https://wiki.openstreetmap.org/wiki/File:Adirondack_Lean-to.jpg
shelter_type_pavilion.jpg CC-BY-SA 4.0 Bwag https://wiki.openstreetmap.org/wiki/File:Obersiebenbrunn_-_Schloss,_Gartenpavillon.JPG
shelter_type_basic_hut.jpg CC-BY-SA 3.0 Luca Bergamasco https://wiki.openstreetmap.org/wiki/File:BivaccoBertoglioNebbia.jpg
shelter_type_sun_shelter.jpg CC-BY-SA 2.0 S2374 https://wiki.openstreetmap.org/wiki/File:Shelter_Providing_Shade_from_the_Sun.jpg
shelter_type_field_shelter… PB Imagic https://wiki.openstreetmap.org/wiki/File:Field_shelter.jpg

sliding_envelope.wav CC0 https://freesound.org/people/MTJohnson/sounds/444431/
snip.wav CC0 https://freesound.org/people/Godowan/sounds/240473/

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.
118 changes: 118 additions & 0 deletions app/src/main/res/drawable/ic_quest_shelter_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<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="M119.4,96c-17.7,30.6 -56.8,41.1 -87.4,23.4S-9.1,62.6 8.6,32S65.4,-9.1 96,8.6C126.6,26.2 137.1,65.4 119.4,96"
android:fillColor="#9BBE55"/>
<path
android:fillColor="#FF000000"
android:pathData="M92.3,27.3H35.7c-4.9,0 -9.4,4.6 -9.4,9.4v56.6c0,4.9 4.6,9.4 9.4,9.4h56.6c4.9,0 9.4,-4.6 9.4,-9.4V36.7C101.7,31.9 97.2,27.3 92.3,27.3L92.3,27.3L92.3,27.3zM94.2,75.1H74.1v20.1H53.9V75.1H33.8V55h20.2V34.8h20.2V55h20.2V75.1z"
android:strokeAlpha="0.25"
android:fillAlpha="0.25"/>
<path
android:pathData="M92.3,24.2H35.7c-4.9,0 -9.4,4.6 -9.4,9.4v56.6c0,4.9 4.6,9.4 9.4,9.4h56.6c4.9,0 9.4,-4.6 9.4,-9.4V33.6C101.7,28.8 97.2,24.2 92.3,24.2L92.3,24.2L92.3,24.2zM94.2,72H74.1v20.1H53.9V72H33.8V51.9h20.2V31.8h20.2v20.1h20.2V72z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M119.4,96c-17.7,30.6 -56.8,41.1 -87.4,23.4S-9.1,62.6 8.6,32S65.4,-9.1 96,8.6C126.6,26.2 137.1,65.4 119.4,96"
android:fillColor="#9BBE55"/>
<path
android:fillColor="#FF000000"
android:pathData="M108.1,65.1l-44.4,-17.6l0,0l0,0l-44.4,17.6l2.5,6.1l15,-6l0,41.3l6.5,0l0,-43.9l20.4,-8.1l20.9,8.3l0,43.7l6.5,0l0,-41.1l14.6,5.8z"
android:strokeAlpha="0.2"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M48.9,14.2l-5.2,10.4l2.4,0l5.5,-10.4z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M69.8,14.2l-5.2,10.4l2.4,0l5.5,-10.4z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M90.7,14.2l-5.2,10.4l2.4,0l5.5,-10.4z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M33.2,24.6l-5.2,10.5l2.4,0l5.5,-10.5z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M54.1,24.6l-5.2,10.5l2.5,0l5.4,-10.5z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M75,24.6l-5.2,10.5l2.4,0l5.5,-10.5z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M95.9,24.6l-5.2,10.5l2.4,0l5.5,-10.5z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M41,35.1l-5.2,10.4l2.5,0l5.4,-10.4z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M82.7,35.1l-5.2,10.4l2.4,0l5.5,-10.4z"
android:strokeAlpha="0.2"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:pathData="M108.1,62.5l-44.4,-17.6l0,0l0,0l-44.4,17.6l2.5,6.1l15,-6l0,41.3l6.5,0l0,-43.9l20.4,-8.1l20.9,8.3l0,43.7l6.5,0l0,-41.1l14.6,5.8z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M48.9,11.6l-5.2,10.5l2.4,0l5.5,-10.5z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M69.8,11.6l-5.2,10.5l2.4,0l5.5,-10.5z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M90.7,11.6l-5.2,10.5l2.4,0l5.5,-10.5z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M33.2,22.1l-5.2,10.4l2.4,0l5.5,-10.4z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M54.1,22.1l-5.2,10.4l2.5,0l5.4,-10.4z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M75,22.1l-5.2,10.4l2.4,0l5.5,-10.4z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M95.9,22.1l-5.2,10.4l2.4,0l5.5,-10.4z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M41,32.5l-5.2,10.4l2.5,0l5.4,-10.4z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M82.7,32.5l-5.2,10.4l2.4,0l5.5,-10.4z"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,17 @@ If there are no signs along the whole street which apply for the highlighted sec
<string name="quest_segregated_separated">Segregated from one another</string>
<string name="quest_segregated_mixed">Cyclists and pedestrians share the same space</string>

<string name="quest_shelterType_title">What kind of shelter is this?</string>
<string name="quest_shelterType_public_transport">Public Transport</string>
<string name="quest_shelterType_picnic_shelter">Picnic Shelter</string>
<string name="quest_shelterType_gazebo">Gazebo</string>
<string name="quest_shelterType_weather_shelter">Weather shelter</string>
<string name="quest_shelterType_lean_to">Lean-to</string>
<string name="quest_shelterType_pavilion">Pavilion</string>
<string name="quest_shelterType_basic_hut">Basic hut</string>
<string name="quest_shelterType_sun_shelter">Sun shelter</string>
<string name="quest_shelterType_field_shelter">Field shelter</string>

<string name="quest_shop_type_title2">What type of shop is this?</string>

<string name="quest_shop_vacant_type_title">This shop has been vacant. What’s here now?</string>
Expand Down
1 change: 1 addition & 0 deletions res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ quest/
road_construction.svg
roof_shape.svg
seating.svg
shelter_type.svg modified from https://wiki.openstreetmap.org/wiki/File:Shelter-14.svg
shower.svg
sidewalk.svg
smoking.svg
Expand Down
59 changes: 59 additions & 0 deletions res/graphics/quest/shelter_type.svg