Skip to content

Commit

Permalink
Merge pull request #5639 from Arthur-GYT/parcel-locker-pickup-mailin
Browse files Browse the repository at this point in the history
Add Parcel Locker Pickup/Mail in quest
  • Loading branch information
westnordost committed May 16, 2024
2 parents 25abdf8 + 5b8c8b2 commit 4d49e0a
Show file tree
Hide file tree
Showing 9 changed files with 305 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ import de.westnordost.streetcomplete.quests.oneway_suspects.data.WayTrafficFlowD
import de.westnordost.streetcomplete.quests.opening_hours.AddOpeningHours
import de.westnordost.streetcomplete.quests.opening_hours_signed.CheckOpeningHoursSigned
import de.westnordost.streetcomplete.quests.orchard_produce.AddOrchardProduce
import de.westnordost.streetcomplete.quests.parcel_locker_mail_in.AddParcelLockerMailIn
import de.westnordost.streetcomplete.quests.parcel_locker_pickup.AddParcelLockerPickup
import de.westnordost.streetcomplete.quests.parking_access.AddBikeParkingAccess
import de.westnordost.streetcomplete.quests.parking_access.AddParkingAccess
import de.westnordost.streetcomplete.quests.parking_fee.AddBikeParkingFee
Expand Down Expand Up @@ -385,6 +387,9 @@ fun questTypeRegistry(
73 to AddBikeRentalCapacity(), // less ambiguous than bike parking
74 to AddBikeParkingCapacity(), // used by cycle map layer on osm.org, OsmAnd

168 to AddParcelLockerPickup(),
169 to AddParcelLockerMailIn(),

// address: usually only visible when just in front + sometimes requires to take "other answer"
75 to AddHousenumber(),
76 to AddAddressStreet(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package de.westnordost.streetcomplete.quests.parcel_locker_mail_in

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.mapdata.Element
import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry
import de.westnordost.streetcomplete.data.osm.mapdata.filter
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.POSTMAN
import de.westnordost.streetcomplete.osm.Tags
import de.westnordost.streetcomplete.quests.YesNoQuestForm
import de.westnordost.streetcomplete.util.ktx.toYesNo

class AddParcelLockerMailIn : OsmFilterQuestType<Boolean>() {

override val elementFilter = "nodes with amenity = parcel_locker and !parcel_mail_in"
override val changesetComment = "Specify if it's possible to drop off parcels with this locker"
override val wikiLink = "Tag:amenity=parcel_locker"
override val icon = R.drawable.ic_quest_parcel_locker_deposit
override val isDeleteElementEnabled = true
override val achievements = listOf(POSTMAN)

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

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes with amenity = parcel_locker")

override fun createForm() = YesNoQuestForm()

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

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.mapdata.Element
import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry
import de.westnordost.streetcomplete.data.osm.mapdata.filter
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.POSTMAN
import de.westnordost.streetcomplete.osm.Tags
import de.westnordost.streetcomplete.quests.YesNoQuestForm
import de.westnordost.streetcomplete.util.ktx.toYesNo

class AddParcelLockerPickup : OsmFilterQuestType<Boolean>() {

override val elementFilter = "nodes with amenity = parcel_locker and !parcel_pickup"
override val changesetComment = "Specify if it's possible to pickup parcels with this locker"
override val wikiLink = "Tag:amenity=parcel_locker"
override val icon = R.drawable.ic_quest_parcel_locker_pickup
override val isDeleteElementEnabled = true
override val achievements = listOf(POSTMAN)

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

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes with amenity = parcel_locker")

override fun createForm() = YesNoQuestForm()

override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["parcel_pickup"] = answer.toYesNo()
}
}
66 changes: 66 additions & 0 deletions app/src/main/res/drawable/ic_quest_parcel_locker_deposit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<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,64c0,35.35 -28.65,64 -64,64s-64,-28.65 -64,-64 28.65,-64 64,-64 64,28.65 64,64"
android:fillColor="#9bbe55"/>
<path
android:fillColor="#FF000000"
android:pathData="m62.69,33 l-41.53,21.41c-0.91,0.53 -1.17,1.33 -1.16,2.48l0.08,1.44 43.84,22.48 43.74,-22.12s0.05,-0.22 0.05,-1c0,0 -0.04,-1.03 -0.27,-1.5 -0.25,-0.54 -0.8,-1.03 -1.15,-1.32 -0.93,-0.77 -1.86,-1.46 -3.45,-2.35 -22.71,-12.84 -37.65,-19.46 -37.65,-19.46 -0.96,-0.36 -1.76,-0.49 -2.51,-0.06z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m20.65,92.96c2.42,1.6 6.84,3.7 11.3,6.12 10.38,5.62 23.5,12.45 30.03,15.13 0.88,0.37 1.41,0.54 2.02,0.57 0.45,0.02 1.2,-0.28 1.2,-0.28s-1.22,-31.2 -1.29,-33.71c-0.07,-2.45 -1.1,-3.26 -2.01,-3.85 -1.42,-0.91 -4.49,-2.32 -4.49,-2.32s-10.76,-5.35 -21.51,-10.99c-5.11,-2.68 -9.43,-5.43 -14.07,-7.69 -0.85,-0.41 -1.85,0.1 -1.85,1.06l0,34.87c0,0.45 0.28,0.84 0.66,1.08z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m106.5,93.24 l-41.31,21.28 -1.3,-33.74c0,-0.44 -0.11,-1.37 -0.25,-1.75 -0.37,-1.11 0.44,-1.56 0.8,-1.74l40.87,-21.05c1.08,-0.56 2.38,0.23 2.38,1.45l0,33.59c0,0.82 -0.46,1.58 -1.2,1.96z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m88.1,67.03s-22.59,11.55 -22.95,12.53c-0.37,0.97 17.72,-7.72 19.84,-8.81 2.4,-1.23 21.22,-11.3 21.22,-12.4 0.01,-0.91 -18.1,8.69 -18.1,8.69z"
android:strokeAlpha="0.5"
android:fillAlpha="0.1"/>
<path
android:fillColor="#FF000000"
android:pathData="m93.1,62.17c-0.4,-0.29 -43.14,-22.63 -43.14,-22.63l-13.26,6.85 43.83,22.6 0.02,0.02 12.83,-6.57s-0.02,-0.06 -0.1,-0.14c-0.06,-0.05 -0.15,-0.12 -0.18,-0.14z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m93.31,62.36c-7.26,3.57 -12.79,6.64 -12.79,6.64 0.18,0.18 0.19,0.42 0.19,0.54 -0.02,0.92 -0.04,1.66 -0.06,2.57 -0.11,4.74 -0.18,9.48 -0.33,14.22 0.53,-0.32 1.18,0.38 1.66,0 0.75,-0.59 2.34,-3.18 2.58,-3.26 0.32,-0.1 0.66,-0.02 0.99,-0.04 1.43,-0.08 4.64,-3 5.33,-3.14 0.66,-0.13 2.84,0.29 2.84,0.29s-0.15,-14.45 -0.21,-16.88c-0.02,-0.86 -0.2,-0.95 -0.2,-0.95z"
android:fillAlpha="0.2"/>
<path
android:pathData="m62.6,24.94 l-41.7,21.5c-0.91,0.54 -1.18,1.34 -1.17,2.49l0.08,1.45 44.03,22.58 43.92,-22.22s0.05,-0.22 0.05,-1.01c0,0 -0.04,-1.03 -0.27,-1.51 -0.26,-0.54 -0.8,-1.03 -1.15,-1.33 -0.94,-0.78 -1.87,-1.46 -3.46,-2.36 -22.81,-12.9 -37.81,-19.54 -37.81,-19.54 -0.97,-0.36 -1.77,-0.49 -2.52,-0.06z"
android:fillColor="#dea66c"/>
<path
android:pathData="m20.38,85.16c2.43,1.61 6.87,3.72 11.35,6.15 10.43,5.64 23.6,12.5 30.16,15.2 0.89,0.37 1.42,0.54 2.03,0.58 0.46,0.02 1.21,-0.28 1.21,-0.28s-1.22,-31.33 -1.3,-33.85c-0.07,-2.46 -1.1,-3.28 -2.01,-3.87 -1.42,-0.91 -4.51,-2.33 -4.51,-2.33s-10.81,-5.37 -21.6,-11.03c-5.13,-2.69 -9.47,-5.45 -14.13,-7.72 -0.86,-0.41 -1.86,0.1 -1.86,1.06l0,35.02c0,0.46 0.28,0.84 0.66,1.09z"
android:fillColor="#b38251"/>
<path
android:pathData="m106.6,85.44 l-41.38,21.34c-0.66,0.34 -1.46,-0.14 -1.46,-0.89l0.07,-32.92c0,-0.44 -0.14,-1.41 -0.27,-1.79 -0.38,-1.12 0.44,-1.57 0.81,-1.75l41.05,-21.14c1.09,-0.56 2.39,0.23 2.39,1.46l0,33.73c0,0.82 -0.46,1.58 -1.21,1.97z"
android:fillColor="#966239"/>
<path
android:pathData="m88.12,59.12s-22.68,11.6 -23.05,12.58c-0.37,0.98 17.8,-7.76 19.92,-8.85 2.41,-1.24 21.31,-11.34 21.31,-12.46 0.01,-0.91 -18.18,8.72 -18.18,8.72z"
android:strokeAlpha="0.5"
android:fillColor="#212121"
android:fillAlpha="0.5"/>
<path
android:pathData="m22.77,71.24 l0.07,10.43 25.18,13.03 -0.07,-10.43z"
android:strokeAlpha="0.5"
android:fillColor="#212121"
android:fillAlpha="0.395415"/>
<path
android:pathData="m93.14,54.24c-0.4,-0.3 -43.32,-22.72 -43.32,-22.72l-13.32,6.88 44.01,22.7 0.02,0.02 12.88,-6.6s-0.02,-0.06 -0.1,-0.14c-0.06,-0.05 -0.15,-0.12 -0.18,-0.14z"
android:fillColor="#ffe0b2"/>
<path
android:pathData="m93.34,54.43c-7.29,3.59 -12.84,6.67 -12.84,6.67 0.18,0.18 0.19,0.42 0.19,0.54 -0.02,0.93 -0.04,1.66 -0.06,2.58 -0.11,4.76 -0.18,9.52 -0.34,14.28 0.54,-0.32 1.18,0.38 1.67,0 0.75,-0.59 2.35,-3.2 2.59,-3.28 0.32,-0.1 0.66,-0.02 0.99,-0.04 1.44,-0.08 4.66,-3.01 5.35,-3.15 0.66,-0.13 2.85,0.3 2.85,0.3s-0.15,-14.51 -0.21,-16.95c-0.02,-0.86 -0.2,-0.95 -0.2,-0.95z"
android:fillColor="#bf9f85"/>
<path
android:fillColor="#FF000000"
android:pathData="M75.56,37.98l-7.38,-0l0.02,-29.46l-8.69,-0l-0.02,29.46l-7.37,-0l11.72,16.72z"
android:fillAlpha="0.2"/>
<path
android:pathData="M59.48,6.45l-0.02,29.46l-7.37,-0l11.72,16.72l11.72,-16.72l-7.38,-0l0.02,-29.46z"
android:fillColor="#fff"/>
</vector>
66 changes: 66 additions & 0 deletions app/src/main/res/drawable/ic_quest_parcel_locker_pickup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<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,64c0,35.35 -28.65,64 -64,64s-64,-28.65 -64,-64 28.65,-64 64,-64 64,28.65 64,64"
android:fillColor="#9bbe55"/>
<path
android:fillColor="#FF000000"
android:pathData="m62.69,33 l-41.53,21.41c-0.91,0.53 -1.17,1.33 -1.16,2.48l0.08,1.44 43.84,22.48 43.74,-22.12s0.05,-0.22 0.05,-1c0,0 -0.04,-1.03 -0.27,-1.5 -0.25,-0.54 -0.8,-1.03 -1.15,-1.32 -0.93,-0.77 -1.86,-1.46 -3.45,-2.35 -22.71,-12.84 -37.65,-19.46 -37.65,-19.46 -0.96,-0.36 -1.76,-0.49 -2.51,-0.06z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m20.65,92.96c2.42,1.6 6.84,3.7 11.3,6.12 10.38,5.62 23.5,12.45 30.03,15.13 0.88,0.37 1.41,0.54 2.02,0.57 0.45,0.02 1.2,-0.28 1.2,-0.28s-1.22,-31.2 -1.29,-33.71c-0.07,-2.45 -1.1,-3.26 -2.01,-3.85 -1.42,-0.91 -4.49,-2.32 -4.49,-2.32s-10.76,-5.35 -21.51,-10.99c-5.11,-2.68 -9.43,-5.43 -14.07,-7.69 -0.85,-0.41 -1.85,0.1 -1.85,1.06l0,34.87c0,0.45 0.28,0.84 0.66,1.08z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m106.5,93.24 l-41.31,21.28 -1.3,-33.74c0,-0.44 -0.11,-1.37 -0.25,-1.75 -0.37,-1.11 0.44,-1.56 0.8,-1.74l40.87,-21.05c1.08,-0.56 2.38,0.23 2.38,1.45l0,33.59c0,0.82 -0.46,1.58 -1.2,1.96z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m88.1,67.03s-22.59,11.55 -22.95,12.53c-0.37,0.97 17.72,-7.72 19.84,-8.81 2.4,-1.23 21.22,-11.3 21.22,-12.4 0.01,-0.91 -18.1,8.69 -18.1,8.69z"
android:strokeAlpha="0.5"
android:fillAlpha="0.1"/>
<path
android:fillColor="#FF000000"
android:pathData="m93.1,62.17c-0.4,-0.29 -43.14,-22.63 -43.14,-22.63l-13.26,6.85 43.83,22.6 0.02,0.02 12.83,-6.57s-0.02,-0.06 -0.1,-0.14c-0.06,-0.05 -0.15,-0.12 -0.18,-0.14z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="m93.31,62.36c-7.26,3.57 -12.79,6.64 -12.79,6.64 0.18,0.18 0.19,0.42 0.19,0.54 -0.02,0.92 -0.04,1.66 -0.06,2.57 -0.11,4.74 -0.18,9.48 -0.33,14.22 0.53,-0.32 1.18,0.38 1.66,0 0.75,-0.59 2.34,-3.18 2.58,-3.26 0.32,-0.1 0.66,-0.02 0.99,-0.04 1.43,-0.08 4.64,-3 5.33,-3.14 0.66,-0.13 2.84,0.29 2.84,0.29s-0.15,-14.45 -0.21,-16.88c-0.02,-0.86 -0.2,-0.95 -0.2,-0.95z"
android:fillAlpha="0.2"/>
<path
android:pathData="m62.6,24.94 l-41.7,21.5c-0.91,0.54 -1.18,1.34 -1.17,2.49l0.08,1.45 44.03,22.58 43.92,-22.22s0.05,-0.22 0.05,-1.01c0,0 -0.04,-1.03 -0.27,-1.51 -0.26,-0.54 -0.8,-1.03 -1.15,-1.33 -0.94,-0.78 -1.87,-1.46 -3.46,-2.36 -22.81,-12.9 -37.81,-19.54 -37.81,-19.54 -0.97,-0.36 -1.77,-0.49 -2.52,-0.06z"
android:fillColor="#dea66c"/>
<path
android:pathData="m20.38,85.16c2.43,1.61 6.87,3.72 11.35,6.15 10.43,5.64 23.6,12.5 30.16,15.2 0.89,0.37 1.42,0.54 2.03,0.58 0.46,0.02 1.21,-0.28 1.21,-0.28s-1.22,-31.33 -1.3,-33.85c-0.07,-2.46 -1.1,-3.28 -2.01,-3.87 -1.42,-0.91 -4.51,-2.33 -4.51,-2.33s-10.81,-5.37 -21.6,-11.03c-5.13,-2.69 -9.47,-5.45 -14.13,-7.72 -0.86,-0.41 -1.86,0.1 -1.86,1.06l0,35.02c0,0.46 0.28,0.84 0.66,1.09z"
android:fillColor="#b38251"/>
<path
android:pathData="m106.6,85.44 l-41.38,21.34c-0.66,0.34 -1.46,-0.14 -1.46,-0.89l0.07,-32.92c0,-0.44 -0.14,-1.41 -0.27,-1.79 -0.38,-1.12 0.44,-1.57 0.81,-1.75l41.05,-21.14c1.09,-0.56 2.39,0.23 2.39,1.46l0,33.73c0,0.82 -0.46,1.58 -1.21,1.97z"
android:fillColor="#966239"/>
<path
android:pathData="m88.12,59.12s-22.68,11.6 -23.05,12.58c-0.37,0.98 17.8,-7.76 19.92,-8.85 2.41,-1.24 21.31,-11.34 21.31,-12.46 0.01,-0.91 -18.18,8.72 -18.18,8.72z"
android:strokeAlpha="0.5"
android:fillColor="#212121"
android:fillAlpha="0.5"/>
<path
android:pathData="m22.77,71.24 l0.07,10.43 25.18,13.03 -0.07,-10.43z"
android:strokeAlpha="0.5"
android:fillColor="#212121"
android:fillAlpha="0.395415"/>
<path
android:pathData="m93.14,54.24c-0.4,-0.3 -43.32,-22.72 -43.32,-22.72l-13.32,6.88 44.01,22.7 0.02,0.02 12.88,-6.6s-0.02,-0.06 -0.1,-0.14c-0.06,-0.05 -0.15,-0.12 -0.18,-0.14z"
android:fillColor="#ffe0b2"/>
<path
android:pathData="m93.34,54.43c-7.29,3.59 -12.84,6.67 -12.84,6.67 0.18,0.18 0.19,0.42 0.19,0.54 -0.02,0.93 -0.04,1.66 -0.06,2.58 -0.11,4.76 -0.18,9.52 -0.34,14.28 0.54,-0.32 1.18,0.38 1.67,0 0.75,-0.59 2.35,-3.2 2.59,-3.28 0.32,-0.1 0.66,-0.02 0.99,-0.04 1.44,-0.08 4.66,-3.01 5.35,-3.15 0.66,-0.13 2.85,0.3 2.85,0.3s-0.15,-14.51 -0.21,-16.95c-0.02,-0.86 -0.2,-0.95 -0.2,-0.95z"
android:fillColor="#bf9f85"/>
<path
android:fillColor="#FF000000"
android:pathData="M63.83,8.52l-11.72,16.72l7.38,0l-0.02,29.46l8.69,0l0.02,-29.46l7.37,0z"
android:fillAlpha="0.2"/>
<path
android:pathData="M59.46,52.63l8.69,0l0.02,-29.46l7.37,0l-11.72,-16.72l-11.72,16.72l7.38,0z"
android:fillColor="#fff"/>
</vector>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,9 @@ If there are no signs along the whole street which apply for the highlighted sec
<string name="produce_brazil_nuts">Brazil nuts</string>
<string name="produce_tung_nuts">Tung nuts</string>

<string name="quest_parcel_locker_pickup">Can you pick up parcels here?</string>
<string name="quest_parcel_locker_mail_in">Can you drop off parcels here?</string>

<string name="quest_parking_access_title2">Who is allowed to park here? Parking may be free or paid.</string>
<string name="quest_access_yes">Any member of the general public</string>
<string name="quest_access_customers">Any person visiting a specific place (e.g. customers only)</string>
Expand Down
4 changes: 3 additions & 1 deletion res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ URLs to other sources used:
- Twemoji 2 (MIT license) https://github.com/twitter/twemoji/
- EmojiOne 2 (CC-BY 4 license) https://github.com/emojione/emojione/tree/2.2.7
- Google Noto Color Emoji https://github.com/googlefonts/noto-emoji/tree/main
(Apache license, version 2.0)
(Apache license, version 2.0)

File Author if not Tobias Zwick / Source
===============================================================================
Expand Down Expand Up @@ -366,6 +366,8 @@ quest/
oneway.svg
opening_hours.svg
opening_hours_signed.svg
parcel_locker_deposit.svg Arthur-GYT, parts from Google Noto Color Emoji: U+1F4E6
parcel_locker_pickup.svg Arthur-GYT, parts from Google Noto Color Emoji: U+1F4E6
parking.svg
parking_access.svg parts taken from EmojiOne 2: U+1F511
parking_fee.svg parts taken from EmojiOne 2: U+1F4B8
Expand Down

0 comments on commit 4d49e0a

Please sign in to comment.