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

created quests for lgbtq people #518

Open
wants to merge 23 commits into
base: modified
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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 @@ -10,8 +10,6 @@ import de.westnordost.streetcomplete.data.meta.getByLocation
import de.westnordost.streetcomplete.data.osm.mapdata.Element
import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
import de.westnordost.streetcomplete.data.osmnotes.notequests.OsmNoteQuestType
import de.westnordost.streetcomplete.quests.osmose.OsmoseDao
import de.westnordost.streetcomplete.quests.osmose.OsmoseQuest
import de.westnordost.streetcomplete.data.quest.QuestTypeRegistry
import de.westnordost.streetcomplete.quests.accepts_cards.AddAcceptsCards
import de.westnordost.streetcomplete.quests.accepts_cash.AddAcceptsCash
Expand All @@ -22,15 +20,15 @@ import de.westnordost.streetcomplete.quests.air_conditioning.AddAirConditioning
import de.westnordost.streetcomplete.quests.air_pump.AddAirCompressor
import de.westnordost.streetcomplete.quests.air_pump.AddBicyclePump
import de.westnordost.streetcomplete.quests.amenity_cover.AddAmenityCover
import de.westnordost.streetcomplete.quests.artwork.AddArtworkType
import de.westnordost.streetcomplete.quests.amenity_indoor.AddIsAmenityIndoor
import de.westnordost.streetcomplete.quests.artwork.AddArtworkType
import de.westnordost.streetcomplete.quests.atm_cashin.AddAtmCashIn
import de.westnordost.streetcomplete.quests.atm_operator.AddAtmOperator
import de.westnordost.streetcomplete.quests.baby_changing_table.AddBabyChangingTable
import de.westnordost.streetcomplete.quests.barrier_bicycle_barrier_installation.AddBicycleBarrierInstallation
import de.westnordost.streetcomplete.quests.barrier_bicycle_barrier_type.AddBicycleBarrierType
import de.westnordost.streetcomplete.quests.barrier_locked.AddBarrierLocked
import de.westnordost.streetcomplete.quests.barrier_height.AddBarrierHeight
import de.westnordost.streetcomplete.quests.barrier_locked.AddBarrierLocked
import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierOnPath
import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierOnRoad
import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierType
Expand All @@ -47,8 +45,8 @@ import de.westnordost.streetcomplete.quests.bike_shop.AddBikeRepairAvailability
import de.westnordost.streetcomplete.quests.bike_shop.AddSecondHandBicycleAvailability
import de.westnordost.streetcomplete.quests.board_type.AddBoardType
import de.westnordost.streetcomplete.quests.bollard_type.AddBollardType
import de.westnordost.streetcomplete.quests.bridge_structure.AddBridgeStructure
import de.westnordost.streetcomplete.quests.brewery.AddBrewery
import de.westnordost.streetcomplete.quests.bridge_structure.AddBridgeStructure
import de.westnordost.streetcomplete.quests.building_colour.AddBuildingColour
import de.westnordost.streetcomplete.quests.building_entrance.AddEntrance
import de.westnordost.streetcomplete.quests.building_entrance_reference.AddEntranceReference
Expand Down Expand Up @@ -80,18 +78,18 @@ import de.westnordost.streetcomplete.quests.crossing_kerb_height.AddCrossingKerb
import de.westnordost.streetcomplete.quests.crossing_markings.AddCrossingMarkings
import de.westnordost.streetcomplete.quests.crossing_signals.AddCrossingSignals
import de.westnordost.streetcomplete.quests.cuisine.AddCuisine
import de.westnordost.streetcomplete.quests.custom.CustomQuest
import de.westnordost.streetcomplete.quests.custom.CustomQuestList
import de.westnordost.streetcomplete.quests.cycleway.AddCycleway
import de.westnordost.streetcomplete.quests.defibrillator.AddDefibrillatorLocation
import de.westnordost.streetcomplete.quests.destination.AddDestination
import de.westnordost.streetcomplete.quests.diet_type.AddHalal
import de.westnordost.streetcomplete.quests.diet_type.AddKosher
import de.westnordost.streetcomplete.quests.diet_type.AddVegan
import de.westnordost.streetcomplete.quests.diet_type.AddVegetarian
import de.westnordost.streetcomplete.quests.drinking_water.AddDrinkingWater
import de.westnordost.streetcomplete.quests.drinking_water_type.AddDrinkingWaterType
import de.westnordost.streetcomplete.quests.existence.CheckExistence
import de.westnordost.streetcomplete.quests.custom.CustomQuestList
import de.westnordost.streetcomplete.quests.custom.CustomQuest
import de.westnordost.streetcomplete.quests.destination.AddDestination
import de.westnordost.streetcomplete.quests.ferry.AddFerryAccessMotorVehicle
import de.westnordost.streetcomplete.quests.ferry.AddFerryAccessPedestrian
import de.westnordost.streetcomplete.quests.fire_hydrant.AddFireHydrantType
Expand All @@ -116,6 +114,10 @@ import de.westnordost.streetcomplete.quests.kerb_height.AddKerbHeight
import de.westnordost.streetcomplete.quests.lanes.AddLanes
import de.westnordost.streetcomplete.quests.leaf_detail.AddForestLeafType
import de.westnordost.streetcomplete.quests.level.AddLevel
import de.westnordost.streetcomplete.quests.lgbtq.LGBTQAccessQuest
import de.westnordost.streetcomplete.quests.lgbtq.LGBTQGenderSpecializationQuest
import de.westnordost.streetcomplete.quests.lgbtq.LGBTQSignedQuest
import de.westnordost.streetcomplete.quests.lgbtq.LGBTQTransgenderSpecializationQuest
import de.westnordost.streetcomplete.quests.map.AddMapSize
import de.westnordost.streetcomplete.quests.map.AddMapType
import de.westnordost.streetcomplete.quests.max_height.AddMaxHeight
Expand All @@ -132,14 +134,16 @@ 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.osmose.OsmoseDao
import de.westnordost.streetcomplete.quests.osmose.OsmoseQuest
import de.westnordost.streetcomplete.quests.parking_access.AddBikeParkingAccess
import de.westnordost.streetcomplete.quests.parking_access.AddParkingAccess
import de.westnordost.streetcomplete.quests.parking_fee.AddBikeParkingFee
import de.westnordost.streetcomplete.quests.parking_fee.AddParkingFee
import de.westnordost.streetcomplete.quests.parking_type.AddParkingType
import de.westnordost.streetcomplete.quests.pharmacy.AddIsPharmacyDispensing
import de.westnordost.streetcomplete.quests.piste_lit.AddPisteLit
import de.westnordost.streetcomplete.quests.piste_difficulty.AddPisteDifficulty
import de.westnordost.streetcomplete.quests.piste_lit.AddPisteLit
import de.westnordost.streetcomplete.quests.piste_ref.AddPisteRef
import de.westnordost.streetcomplete.quests.pitch_lit.AddPitchLit
import de.westnordost.streetcomplete.quests.place_name.AddPlaceName
Expand Down Expand Up @@ -171,14 +175,14 @@ import de.westnordost.streetcomplete.quests.shelter_type.AddShelterType
import de.westnordost.streetcomplete.quests.shop_type.CheckShopExistence
import de.westnordost.streetcomplete.quests.shop_type.CheckShopType
import de.westnordost.streetcomplete.quests.shop_type.SpecifyShopType
import de.westnordost.streetcomplete.quests.show_poi.ShowSeating
import de.westnordost.streetcomplete.quests.show_poi.ShowBicycleStuff
import de.westnordost.streetcomplete.quests.show_poi.ShowBusiness
import de.westnordost.streetcomplete.quests.show_poi.ShowCamera
import de.westnordost.streetcomplete.quests.show_poi.ShowFixme
import de.westnordost.streetcomplete.quests.show_poi.ShowMachine
import de.westnordost.streetcomplete.quests.show_poi.ShowOther
import de.westnordost.streetcomplete.quests.show_poi.ShowRecycling
import de.westnordost.streetcomplete.quests.show_poi.ShowSeating
import de.westnordost.streetcomplete.quests.show_poi.ShowTrafficStuff
import de.westnordost.streetcomplete.quests.show_poi.ShowVacant
import de.westnordost.streetcomplete.quests.sidewalk.AddSidewalk
Expand Down Expand Up @@ -624,6 +628,10 @@ fun getQuestTypeList(
EE_QUEST_OFFSET + 40 to AddPisteLit(),
EE_QUEST_OFFSET + 35 to AddPisteRef(),
EE_QUEST_OFFSET + 36 to AddPisteDifficulty(),
EE_QUEST_OFFSET + 45 to LGBTQSignedQuest(),
EE_QUEST_OFFSET + 46 to LGBTQAccessQuest(),
EE_QUEST_OFFSET + 47 to LGBTQGenderSpecializationQuest(),
EE_QUEST_OFFSET + 48 to LGBTQTransgenderSpecializationQuest(),
EE_QUEST_OFFSET + 10 to OsmoseQuest(osmoseDao),
EE_QUEST_OFFSET + 11 to CustomQuest(customQuestList),
// POI quests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package de.westnordost.streetcomplete.quests.lgbtq

import de.westnordost.streetcomplete.data.quest.AllCountriesExcept

val LGBTExcludedCountries = AllCountriesExcept(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said on telegram, I think that list would benefit from having a comment that explain why it is here. E.g., is it because we think tagging in those countries would be dangerous for the tagger, for the tagged subject, for the project, or generate too much false positive and/or vandalism ?

From what I see, the list is made of countries where homosexuality is illegal. While I think that's a good idea for 98% of the list, I also think it miss a few countries. For example, Russia (RU) banned the LGBT movement for extremism, and there is numerous reports of crackdown since 6 months. Yet, homosexuality is not illegal per se, and Russia is not on the list. But I think having that quest displayed in Russia might have consequence for the software project in itself (most likely being banned in Russia or something like that ).

And there is also the question of list change. Singapore (SG) struck down its law on homosexuality last year. So it should arguably be removed. The law was also struck because only male homosexuality was affected, which also bring the question of a very hypothetical place for lesbians in a country where that's not illegal, but where a equivalent for men would. Would that country be on the list ? (that's very hypothetical, I never heard of anything like this in practice, and if that exist, that can be tagged outside SCEE so it might not be a bid deal). Kazakhstan (KZ) is also looking at enacting the same law as Russia (and so does Georgia, afaik).

Given the size of the list, I also think that it would be nice to have a comment with the full name of the country, as well as the reason. And maybe order by alphabetical order of the iso code as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with everything said here, the list was very much just a first draft that amalgamated from a few human rights websites and was no doubt out of date, for the reason listed with the things would you mind getting that list together?

Copy link

@mscherer mscherer Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I finally found the time to split and review the list: https://github.com/mscherer/StreetComplete/tree/lgbtq

Not sure how do you want to integrate the fix.

Some countries decriminalized homosexuality in 2022 and 2023 so they have been removed. I added also one that was missing (Iran) and split along the divide "homosexuality illegal" and "lgbt propaganda" law. (and I also noticed I got confused between Kazakhstan and Kirgistan...). I am also checking if one is missing, so the list might change (hence the edit of my comment)

listOf(
"AF",
"DZ",
"AO",
"AG",
"BD",
"BB",
"BI",
"CM",
"DM",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed (I think), this was decriminalized in april 2024: https://www.bbc.co.uk/news/world-latin-america-68880033

"EG",
"ER",
"ET",
"GH",
"GD",
"GN",
"GY",
"ID",
"JM",
"KE",
"KI",
"KW",
"LB",
"LR",
"LY",
"MW",
"MY",
"MV",
"MR",
"MU",
"MA",
"MM",
"NA",
"NG",
"OM",
"PK",
"PG",
"QA",
"WS",
"SA",
"SN",
"SL",
"SG",
"SB",
"SO",
"SS",
"LK",
"TG",
"TO",
"TN",
"TM",
"TV",
"UG",
"UZ",
"YE",
"ZM",
"ZW"
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.westnordost.streetcomplete.quests.lgbtq

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.view.image_select.DisplayItem
import de.westnordost.streetcomplete.view.image_select.Item

enum class LGTBQAccess(val osmValue: String) {
NO("no"),
WELCOME("welcome"),
PRIMARY("primary"),
ONLY("only"),
}

fun List<LGTBQAccess>.toItems() = this.map { it.asItem() }
fun LGTBQAccess.asItem(): DisplayItem<LGTBQAccess> = Item(this, iconResId, titleResId)

val LGTBQAccess.titleResId: Int get() = when (this) {
LGTBQAccess.NO -> R.string.quest_lgbtq_access_no
LGTBQAccess.WELCOME -> R.string.quest_lgbtq_access_welcome
LGTBQAccess.PRIMARY -> R.string.quest_lgbtq_access_primary
LGTBQAccess.ONLY -> R.string.quest_lgbtq_access_only
}

// TOOD: populate icons
val LGTBQAccess.iconResId: Int get() = when (this) {
LGTBQAccess.NO -> R.drawable.surface_asphalt
LGTBQAccess.WELCOME -> R.drawable.surface_asphalt
LGTBQAccess.PRIMARY -> R.drawable.surface_asphalt
LGTBQAccess.ONLY -> R.drawable.surface_asphalt
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package de.westnordost.streetcomplete.quests.lgbtq

data class LGBTQAccessAnswer(
val access: LGTBQAccess?,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package de.westnordost.streetcomplete.quests.lgbtq

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

class LGBTQAccessForm: AImageListQuestForm<LGTBQAccess, LGBTQAccessAnswer>() {

override val items get() = listOf(
LGTBQAccess.NO,
LGTBQAccess.WELCOME,
LGTBQAccess.PRIMARY,
LGTBQAccess.ONLY
).toItems()

override val itemsPerRow = 3

override val otherAnswers get() = listOfNotNull(
AnswerItem(R.string.quest_lgbtq_access_not_marked) {
applyAnswer(LGBTQAccessAnswer(null))
}
)

override fun onClickOk(selectedItems: List<LGTBQAccess>) {
val value = selectedItems.single()
applyAnswer(LGBTQAccessAnswer(value))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package de.westnordost.streetcomplete.quests.lgbtq

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.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement
import de.westnordost.streetcomplete.osm.Tags

class LGBTQAccessQuest : OsmFilterQuestType<LGBTQAccessAnswer>() {
override val elementFilter = """
nodes, ways with (!lgbtq and lgbtq:signed = yes)
and !memorial and !historic
"""

// countries that are listed here ban lgbtq people
override val enabledInCountries = LGBTExcludedCountries

override val changesetComment = "Survey lgbtq access"
override val wikiLink = "Key:lgbtq"
// TODO: replace me
override val icon = R.drawable.ic_quest_shop
override val achievements = listOf(EditTypeAchievement.CITIZEN)

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

override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable<Element> =
mapData.filter { isApplicableTo(it) }

override fun isApplicableTo(element: Element): Boolean = filter.matches(element)
override fun createForm() = LGBTQAccessForm()

override fun applyAnswerTo(answer: LGBTQAccessAnswer, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
if (answer.access == null) {
tags["lgbtq:signed"] = "no"
} else {
tags["lgbtq"] = answer.access.osmValue
tags["lgbtq:signed"] = "yes"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.westnordost.streetcomplete.quests.lgbtq

enum class LGBTQGenderSpecialization {
NONE,
MEN,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the nitpicking, but since men is a plural, and wom and and non_binary are singular, shouldn't it be harmonised ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see, this is from the tags, guess it make more sense, so I guess this can be ignored (or fixed in the map)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even think about this but now it is going to hurt my eyes every time I see the tags on the map, I dont really want to take on the task of cleaning up the map data though so unless someone volunteers I think we just leave it for now

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the wiki seems to be consistent: https://wiki.openstreetmap.org/wiki/Key:lgbtq and use plural for men and women.

And based on https://taginfo.openstreetmap.org/keys/lgbtq#similar, I see that plural is consistently used for those, so since the patch is not merged, I think WOMAN should be changed to WOMEN (and fixed elsewhere in the patch).

It doesn't solve the issue with non_binary being singular

WOMAN,
NON_BINARY,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.westnordost.streetcomplete.quests.lgbtq

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

class LGBTQGenderSpecializationForm : AbstractOsmQuestForm<LGBTQGenderSpecialization>() {
override val buttonPanelAnswers = listOf(
AnswerItem(R.string.quest_lgbtq_gender_specialization_men) { applyAnswer(LGBTQGenderSpecialization.MEN) },
AnswerItem(R.string.quest_lgbtq_gender_specialization_woman) { applyAnswer(LGBTQGenderSpecialization.WOMAN) },
AnswerItem(R.string.quest_lgbtq_gender_specialization_non_binary) { applyAnswer(LGBTQGenderSpecialization.NON_BINARY) },
AnswerItem(R.string.quest_lgbtq_gender_specialization_none) { applyAnswer(LGBTQGenderSpecialization.NONE) },
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package de.westnordost.streetcomplete.quests.lgbtq

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

class LGBTQGenderSpecializationQuest : OsmFilterQuestType<LGBTQGenderSpecialization>() {
override val elementFilter = """
nodes with lgbtq ~ primary|only and !(lgbtq:men or lgbtq:woman or lgbtq:non_binary)
and !memorial and !historic
"""

// countries that are listed here ban lgbtq people
override val enabledInCountries = LGBTExcludedCountries

override val changesetComment = "Survey lgbtq specificity"
override val wikiLink = "Key:lgbtq"
// TODO: replace me
override val icon = R.drawable.ic_quest_shop
override val achievements = listOf(EditTypeAchievement.CITIZEN)

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

override fun createForm() = LGBTQGenderSpecializationForm()

override fun applyAnswerTo(answer: LGBTQGenderSpecialization, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) =
when (answer) {
LGBTQGenderSpecialization.NONE -> {
tags["lgbtq:men"] = "welcome"
tags["lgbtq:woman"] = "welcome"
tags["lgbtq:non_binary"] = "welcome"
}
LGBTQGenderSpecialization.MEN -> {
tags["lgbtq:men"] = tags["lgbtq"] ?: "primary"
}
LGBTQGenderSpecialization.WOMAN -> {
tags["lgbtq:woman"] = tags["lgbtq"] ?: "primary"
}
LGBTQGenderSpecialization.NON_BINARY -> {
tags["lgbtq:non_binary"] = tags["lgbtq"] ?: "primary"
}
}
}
Loading