Skip to content

Commit

Permalink
New Quest: Does this caravan area have a sanitary_dump_station? (#5363)
Browse files Browse the repository at this point in the history
* Draft AddSanitaryDumpStation

#5233

* Update AddSanitaryDumpStation.kt

* add sanitary_dump_station example pic

* AddSanitaryDumpStation: Improve elementFilter

* Create sanitary_dump_station_illustration.jpg

* drawables

* Update quest_sanitary_dump_station.xml

* fix drawables

* Update strings.xml

* Update app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt

Co-authored-by: Flo Edelmann <[email protected]>

* Update app/src/main/res/authors.txt

Co-authored-by: Flo Edelmann <[email protected]>

* remove image

* examlple signs for sanitary dump station

* alternative sign

* new pictures

* remove  attribution to missing picture

---------

Co-authored-by: Flo Edelmann <[email protected]>
Co-authored-by: Tobias Zwick <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2023
1 parent 8b57805 commit 9de3369
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ import de.westnordost.streetcomplete.quests.religion.AddReligionToWaysideShrine
import de.westnordost.streetcomplete.quests.road_name.AddRoadName
import de.westnordost.streetcomplete.quests.road_name.RoadNameSuggestionsSource
import de.westnordost.streetcomplete.quests.roof_shape.AddRoofShape
import de.westnordost.streetcomplete.quests.sanitary_dump_station.AddSanitaryDumpStation
import de.westnordost.streetcomplete.quests.seating.AddSeating
import de.westnordost.streetcomplete.quests.segregated.AddCyclewaySegregation
import de.westnordost.streetcomplete.quests.self_service.AddSelfServiceLaundry
Expand Down Expand Up @@ -454,6 +455,7 @@ fun questTypeRegistry(
115 to AddCampDrinkingWater(),
116 to AddCampShower(),
117 to AddCampPower(),
162 to AddSanitaryDumpStation(),

// toilets
118 to AddToiletAvailability(), // OSM Carto, shown in OsmAnd descriptions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package de.westnordost.streetcomplete.quests.sanitary_dump_station;

Check failure on line 1 in app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Unnecessary semicolon

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement
import de.westnordost.streetcomplete.osm.Tags
import de.westnordost.streetcomplete.sanitary_dump_station.AddSanitaryDumpStationForm
import de.westnordost.streetcomplete.util.ktx.toYesNo

class AddSanitaryDumpStation : OsmFilterQuestType<Boolean>() {

override val elementFilter = """
nodes, ways with
(
tourism = caravan_site
or tourism = camping_site and caravans = yes and !backcountry
)
and access !~ private|no
and !sanitary_dump_station
"""

override val changesetComment = "Specify if there is a sanitary dump station at camp or caravan site"
override val wikiLink = "Key:sanitary_dump_station"
override val icon = R.drawable.ic_quest_caravan
override val achievements = listOf(EditTypeAchievement.OUTDOORS)

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

override fun createForm() = AddSanitaryDumpStationForm()

override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["sanitary_dump_station"] = answer.toYesNo()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package de.westnordost.streetcomplete.sanitary_dump_station

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm
import de.westnordost.streetcomplete.quests.AnswerItem

class AddSanitaryDumpStationForm : AbstractOsmQuestForm<Boolean>() {

override val contentLayoutResId = R.layout.quest_sanitary_dump_station

override val buttonPanelAnswers = listOf(
AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(false) },
AnswerItem(R.string.quest_generic_hasFeature_yes) { applyAnswer(true) }
)
}
42 changes: 42 additions & 0 deletions app/src/main/res/drawable/ic_quest_caravan.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<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="M64,64m-64,0a64,64 0,1 1,128 0a64,64 0,1 1,-128 0"
android:strokeAlpha="0.2"
android:strokeWidth="12"
android:fillColor="#9bbe55"/>
<path
android:fillColor="#000"
android:pathData="m99.86,79.98h16.05v8h-8v12h-8v-12h-43.98c0,6.63 -5.37,12.02 -12,12.02s-12,-5.37 -12,-12c-3.41,-0.13 -6.81,0.19 -10.17,-0.19 -8.03,-1.25 -10.65,-9.79 -9.5,-19.84 -0.33,0 87.61,12 87.61,12z"
android:fillAlpha="0.2"/>
<path
android:pathData="m23.93,84l76,0c-0,-24 -0,-56 -28,-56l-32,0c-24,0 -40,56 -16,56z"
android:fillColor="#deb486"/>
<path
android:pathData="m99.35,64c0.52,6.73 0.54,13.65 0.54,20l-76,0c-9.68,0 -12.85,-9.12 -11.61,-20z"
android:fillColor="#c84747"/>
<path
android:pathData="m43.93,68a16,16 0,0 1,16 16l-32,0a16,16 0,0 1,16 -16z"
android:fillColor="#913636"/>
<path
android:pathData="M43.95,84.02m12,0a12,12 0,1 0,-24 0a12,12 0,1 0,24 0"
android:fillColor="#555"/>
<path
android:pathData="m115.93,76l-0,8l-8,0l-0,12l-8,0l-0,-12l-8,-0l-0,-8z"
android:fillColor="#aaa"/>
<path
android:pathData="M79.93,44L71.93,44A4,4 0,0 0,67.93 48L67.93,76A4,4 0,0 0,71.93 80L79.93,80A4,4 0,0 0,83.93 76L83.93,48A4,4 0,0 0,79.93 44z"
android:fillColor="#c08268"/>
<path
android:pathData="M51.93,44L31.93,44A4,4 0,0 0,27.93 48L27.93,56A4,4 0,0 0,31.93 60L51.93,60A4,4 0,0 0,55.93 56L55.93,48A4,4 0,0 0,51.93 44z"
android:fillColor="#95685e"/>
<path
android:pathData="m90.69,35.98c1.02,1.22 1.93,2.57 2.74,4l-71.98,0c1,-1.43 2.06,-2.77 3.18,-4z"
android:fillColor="#c84747"/>
<path
android:pathData="M43.93,84m5.95,0a5.95,5.95 0,1 0,-11.89 0a5.95,5.95 0,1 0,11.89 0"
android:fillColor="#aaa"/>
</vector>
23 changes: 23 additions & 0 deletions app/src/main/res/drawable/sanitary_dump_station_sign1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<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="M16,0L112,0A16,16 0,0 1,128 16L128,112A16,16 0,0 1,112 128L16,128A16,16 0,0 1,0 112L0,16A16,16 0,0 1,16 0z"
android:fillColor="#73411f"/>
<path
android:pathData="m8,120h112v-40h-72v8h28c2,0 4,2 4,4v16c0,2 -2,4 -4,4h-48c-2,0 -4,-2 -4,-4v-16c0,-2 2,-4 4,-4h8v-8h-28z"
android:strokeWidth=".19854"
android:fillColor="#fff"/>
<path
android:pathData="m120,68v-6h-16v-30c0,-8 -8,-16 -16,-16h-48c-8,0 -16,8 -16,16v20c0,8 8,16 16,16h11c0,-8 5,-14 13,-14s13,6 13,14zM76,28c0,-2 2,-4 4,-4h8c2,0 4,2 4,4v8c0,2 -2,4 -4,4h-8c-2,0 -4,-2 -4,-4zM60,44h-20c-2,0 -4,-2 -4,-4v-12c0,-2 2,-4 4,-4h20c2,0 4,2 4,4v12c0,2 -2,4 -4,4z"
android:strokeWidth=".19854"
android:fillColor="#fff"/>
<path
android:pathData="M64,67m-9,0a9,9 0,1 1,18 0a9,9 0,1 1,-18 0"
android:fillColor="#fff"/>
<path
android:pathData="m44,72v20h6l-8,10 -8,-10h6v-20z"
android:fillColor="#fff"/>
</vector>
29 changes: 29 additions & 0 deletions app/src/main/res/drawable/sanitary_dump_station_sign2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<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="M16,0L112,0A16,16 0,0 1,128 16L128,112A16,16 0,0 1,112 128L16,128A16,16 0,0 1,0 112L0,16A16,16 0,0 1,16 0z"
android:fillColor="#25b"/>
<path
android:pathData="m40,16c-8,0 -20,4 -20,6l4,6h24v4h-14c-4,0 -10,14 -10,16 -2,0 -12,2 -12,4v16h8c0,-8 6,-14 14,-14s14,6 14,14h32c0,-8 6,-14 14,-14 8,0 14,6 14,14h4c2,0 4,-2 4,-4v-40c0,-4 -4,-8 -8,-8zM82,24h24c1.11,0 2,0.89 2,2v14c0,1.11 -0.89,2 -2,2h-24c-1.11,0 -2,-0.89 -2,-2v-14c0,-1.11 0.89,-2 2,-2zM36,36h12v12h-20c0,-2 4,-12 8,-12zM64,48c4.42,0 8,3.58 8,8s-3.58,8 -8,8 -8,-3.58 -8,-8 3.58,-8 8,-8zM34,58c-5.52,0 -10,4.48 -10,10s4.48,10 10,10 10,-4.48 10,-10 -4.48,-10 -10,-10zM94,58c-5.52,0 -10,4.48 -10,10s4.48,10 10,10 10,-4.48 10,-10 -4.48,-10 -10,-10zM52,72 L64,84 76,72z"
android:fillColor="#fff"/>
<path
android:pathData="m112,84h-24v26h-48v-26h-24"
android:strokeWidth="4"
android:fillColor="#00000000"
android:strokeColor="#fff"/>
<path
android:pathData="m48,92s5.02,-4 8,-4 5.02,4 8,4 5.02,-4 8,-4 8,4 8,4"
android:strokeWidth="4"
android:fillColor="#00000000"
android:strokeColor="#fff"
android:strokeLineCap="round"/>
<path
android:pathData="m48,102s5.02,-4 8,-4 5.02,4 8,4 5.02,-4 8,-4 8,4 8,4"
android:strokeWidth="4"
android:fillColor="#00000000"
android:strokeColor="#fff"
android:strokeLineCap="round"/>
</vector>
36 changes: 36 additions & 0 deletions app/src/main/res/layout/quest_sanitary_dump_station.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/quest_sanitary_dump_station_description"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:showDividers="middle"
android:divider="@drawable/space_16dp"
android:layout_marginTop="16dp">

<ImageView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/sanitary_dump_station_sign1" />

<ImageView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/sanitary_dump_station_sign2" />

</LinearLayout>

</LinearLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,8 @@ Before uploading your changes, the app checks with a &lt;a href=\"https://www.we
<string name="quest_camp_type_caravans_only">Only motor homes, travel trailers, …</string>
<string name="quest_camp_type_tents_only">Only tents</string>
<string name="quest_camp_type_backcountry">Backcountry camping (no facilities)</string>
<string name="quest_sanitary_dump_station_title">Is there a sanitary dump station?</string>
<string name="quest_sanitary_dump_station_description">Facility for depositing human waste from a toilet holding tank of a motorhome, long haul truck, etc. Usually indicated by a sign like this:</string>

<string name="quest_carWashType_title">What kind of car wash is this?</string>
<string name="quest_carWashType_automated">Automated</string>
Expand Down
9 changes: 7 additions & 2 deletions res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ quest/
building.svg
building_construction.svg
building_height.svg
building_inside.svg
building_inside.svg
building_levels.svg
building_underground.svg
bus.svg modified from Twemoji: U+1F68D
Expand All @@ -309,6 +309,7 @@ quest/
car_air_compressor.svg
car_charger.svg parts taken from Twemoji: U+1F698 and U+1F50C
car_charger_capacity.svg parts taken from Twemoji: U+1F50C
caravan.svg
card.svg
cash.svg
check.svg
Expand All @@ -322,7 +323,7 @@ quest/
fee.svg
ferry.svg modified from Twemoji: U+26F4
ferry_pedestrian.svg modified from Twemoji: U+26F4
fire.svg
fire.svg
fire_hydrant.svg
fire_hydrant_diameter.svg
fire_hydrant_grass.svg
Expand Down Expand Up @@ -539,6 +540,10 @@ royal cypher/
Scottish_Crown.svg CC-BY-SA 3.0 https://commons.wikimedia.org/wiki/File:Royal_Crown_of_Scotland_(Heraldry).svg (adapted)
VR.svg Public Domain https://commons.wikimedia.org/wiki/File:Royal_Cypher_of_Queen_Victoria.svg (adapted)

sanitary dump station/
sign1.svg
sign2.svg

sidewalk/
no.svg
yes.svg
Expand Down

0 comments on commit 9de3369

Please sign in to comment.