-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: modified
Are you sure you want to change the base?
Changes from 20 commits
83c725f
d4d6c8b
3cce8cc
1f0f3ff
9a75e34
1786667
9fcc650
f03893a
f9bdfcb
111c0df
320922e
6772f44
29629e4
32b66cd
caafa4f
800e35d
9673685
0fbf2c7
316e9a3
7d656cc
881d19c
8af39b4
e9963af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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", | ||
// 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 | ||
val LGBTHomosexualityIllegalCountries = | ||
listOf( | ||
// United Arab Emirates | ||
"AE", | ||
// Afghanistan | ||
"AF", | ||
// Bangladesh | ||
"BD", | ||
// Burundi | ||
"BI", | ||
// Brunei Darussalam | ||
"BN", | ||
// Cameroon | ||
"CM", | ||
// Dominica | ||
"DM", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not enforced and also recently declared against constitution: https://www.lgbtqnation.com/2024/06/this-african-country-just-made-history-by-decriminalizing-homosexuality/ |
||
"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,25 @@ | ||
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) { | ||
tempHideQuest() | ||
}, | ||
jan-leila marked this conversation as resolved.
Show resolved
Hide resolved
|
||
AnswerItem(R.string.quest_lgbtq_access_hide_forever) { | ||
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 | ||
or shop ~ erotic|books | ||
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() | ||
} |
There was a problem hiding this comment.
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 ?