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 all 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 @@ -118,6 +118,9 @@ import de.westnordost.streetcomplete.quests.lanes.AddLanes
import de.westnordost.streetcomplete.quests.leaf_detail.AddForestLeafType
import de.westnordost.streetcomplete.quests.leaf_detail.AddTreeLeafType
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.LGBTQTransgenderSpecializationQuest
import de.westnordost.streetcomplete.quests.map.AddMapSize
import de.westnordost.streetcomplete.quests.map.AddMapType
import de.westnordost.streetcomplete.quests.max_height.AddMaxHeight
Expand Down Expand Up @@ -637,6 +640,9 @@ fun getQuestTypeList(
EE_QUEST_OFFSET + 50 to AddCaravanSiteType(),
EE_QUEST_OFFSET + 52 to AddSaunaAvailability(),
EE_QUEST_OFFSET + 53 to AddSwimmingPoolAvailability(),
EE_QUEST_OFFSET + 54 to LGBTQAccessQuest(),
EE_QUEST_OFFSET + 55 to LGBTQGenderSpecializationQuest(),
EE_QUEST_OFFSET + 56 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,160 @@
package de.westnordost.streetcomplete.quests.lgbtq

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

// countries with a LGBT propaganda law, and not in the list of country
// where homosexuality is illegal
val LGBTPropagandaCountries =
listOf(
// Belarus, see https://www.reuters.com/world/europe/belarus-prepares-law-against-lgbt-propaganda-state-media-says-2024-02-19/
// "BY",
// Georgia, see https://oc-media.org/georgian-dream-announces-draft-law-against-pseudo-liberal-ideology/
// "GE",

Choose a reason for hiding this comment

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

Unfortunately, I think we have to uncomment the country since the 3rd of october 2024:
https://edition.cnn.com/2024/09/17/europe/georgia-parliament-lgbtq-rights-intl/index.html

Choose a reason for hiding this comment

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

I think it might also be useful to prepare:

Choose a reason for hiding this comment

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

Ok so I didn't even read the comment, Uganda is already in the other list, no need to add it here.

// Kyrgyzstan, see https://en.wikipedia.org/wiki/Kyrgyz_anti-LGBT_propaganda_law
"KY",
// Russia, since 2013 and worst since 2023
"RU",
)

// countries where homosexuality is illegal
// even if unenforced or just for male

Choose a reason for hiding this comment

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

For the sake of easier audit later, what about adding a date from last check as a comment here ?

val LGBTHomosexualityIllegalCountries =
listOf(
// United Arab Emirates
"AE",
// Afghanistan
"AF",
// Bangladesh
"BD",
// Burundi
"BI",
// Brunei Darussalam
"BN",
// Cameroon
"CM",
// Dominica
"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

// Algeria
"DZ",
// Egypt
"EG",
// Eritrea
"ER",
// Ethiopia
"ET",
// Grenada
"GD",
// Ghana
"GH",
// Gambia
"GM",
// Guinea
"GN",
// Guyana
"GY",
// Indonesia
// not illegal, except in one province where it is enforced
"ID",
// Iraq
"IQ",
// Iran
"IR",
// Jamaica
"JM",
// Kenya
"KE",
// Kiribati, just for male, but not enforced
"KI",
// Comoros
"KM",
// Kuwait, just for male
"KW",
// Lebanon, unsure in 2024, cf wikipedia
"LB",
// Sri Lanka
"LK",
// Liberia
"LR",
// Libya
"LY",
// Morocco
"MA",
// Myanmar
"MM",
// Mauritania
"MR",
// Maldives, not enforced
"MV",
// Malawi
"MW",
// Malaysia
"MY",
// Namibia, not enforced

Choose a reason for hiding this comment

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

"NA",
// Nigeria
"NG",
// Niue
"NU",
// Oman
"OM",
// Papua New Guinea , illegal for male only
"PG",
// Pakistan
"PK",
// Qatar
"QA",
// Saudi Arabia
"SA",
// Solomon Islands
"SB",
// Sudan
"SD",
// Sierra Leone, illegal for male only
"SL",
// Senegal
"SN",
// Somalia
"SO",
// South Sudan
"SS",
// Eswatini
"SZ",
// Chad
"TD",
// Togo
"TG",
// Turkmenistan, illegal for male only
"TM",
// Tunisia
"TN",
// Tonga, illegal for male only
"TO",
// Tuvalu,illegal for male only, not enforced
"TV",
// Tanzania
"TZ",
// Uganda
"UG",
// Uzbekistan, illegal for male only
"UZ",
// Saint Lucia
"WL",
// Samoa, illegal for male only, not enforced
"WS",
// Saint Vincent and the Grenadines
"WV",
// Yemen
"YE",
// Zambia
"ZM",
// Zimbabwe
"ZW"
)

// country where mapping would be fruitless and/or dangerous
val LGBTExcludedCountries = AllCountriesExcept(
listOf(
LGBTHomosexualityIllegalCountries,
LGBTPropagandaCountries
).flatten()
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.westnordost.streetcomplete.quests.lgbtq

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AListQuestForm
import de.westnordost.streetcomplete.quests.AnswerItem
import de.westnordost.streetcomplete.quests.TextItem

class LGBTQAccessForm : AListQuestForm<String?>() {

override val items get() = listOf<TextItem<String?>>(
TextItem("no", R.string.quest_lgbtq_access_no),
TextItem("welcome", R.string.quest_lgbtq_access_welcome),
TextItem("primary", R.string.quest_lgbtq_access_primary),
TextItem("only", R.string.quest_lgbtq_access_only),
)

override val otherAnswers get() = listOfNotNull(
AnswerItem(R.string.quest_lgbtq_access_not_marked) {
hideQuest()
},
)
}
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.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<String?>() {
override val elementFilter = """
nodes, ways with (
amenity ~ swingerclub|nightclub|bar|pub|cafe|restaurant|place_of_worship|community_centre|library|doctors|social_facility|veterinary
or shop ~ erotic|books|music
or leisure ~ sauna|nightclub|nightlife
)
and (!seasonal or seasonal = no)
and !brand and !wikipedia:brand and !wikidata:brand
and !memorial and !historic
and !lgbtq
"""

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

override val changesetComment = "Survey lgbtq access"
override val wikiLink = "Key:lgbtq"
override val icon = R.drawable.ic_quest_lgbtq
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: String?, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
answer?.let {
tags["lgbtq"] = it
}
}
}
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,44 @@
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"
override val icon = R.drawable.ic_quest_gender
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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.westnordost.streetcomplete.quests.lgbtq

enum class LGBTQTransgenderSpecialization {
YES,
NO,
BANNED,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package de.westnordost.streetcomplete.quests.lgbtq

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

class LGBTQTransgenderSpecializationForm : AbstractOsmQuestForm<LGBTQTransgenderSpecialization>() {
override val buttonPanelAnswers = listOf(
AnswerItem(R.string.quest_generic_hasFeature_no) {
applyAnswer(
LGBTQTransgenderSpecialization.NO
)
},
AnswerItem(R.string.quest_generic_hasFeature_yes) {
applyAnswer(
LGBTQTransgenderSpecialization.YES
)
},
AnswerItem(R.string.quest_lgbtq_transgender_specialization_banned) {
applyAnswer(
LGBTQTransgenderSpecialization.BANNED
)
},
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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 LGBTQTransgenderSpecializationQuest : OsmFilterQuestType<LGBTQTransgenderSpecialization>() {
override val elementFilter = """
nodes, ways with lgbtq ~ primary|only and !lgbtq:trans
and !memorial and !historic
"""

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

@mscherer mscherer Mar 3, 2024

Choose a reason for hiding this comment

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

With the current list, that would prevent mapping in place where trans folks are more protected (and so potentially more accepted) than homosexual ones. For example, as I discovered while reading A Global Analysis of Transgender Rights: Introducing the Trans Rights Indicator Project (TRIP) , Pakistan score a lot higher on the indicator for trans protection than on regular (eg LGB) indicators.

Copy link
Author

Choose a reason for hiding this comment

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

this would also be a good idea but I think how we implement it is a bit more difficult because for this quest to show up a place already needs to be tagged as LGBTQ primary, maybe we get the list of pro trans countries and anti LGB countries together and find the intersection and create a new quest just for them?


override val changesetComment = "Survey lgbtq transgender specialization"
override val wikiLink = "Key:lgbtq"
override val icon = R.drawable.ic_quest_trans
override val achievements = listOf(EditTypeAchievement.CITIZEN)

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

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

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

override fun applyAnswerTo(answer: LGBTQTransgenderSpecialization, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
when (answer) {
LGBTQTransgenderSpecialization.YES -> tags["lgbtq:trans"] = "primary"
LGBTQTransgenderSpecialization.NO -> tags["lgbtq:trans"] = "welcome"
LGBTQTransgenderSpecialization.BANNED -> tags["lgbtq:trans"] = "no"
}
}

override fun createForm() = LGBTQTransgenderSpecializationForm()
}
Binary file added app/src/main/res/drawable-xhdpi/lgbtq_welcome.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading