-
-
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 4 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,64 @@ | ||
package de.westnordost.streetcomplete.quests.lgbtq | ||
|
||
import de.westnordost.streetcomplete.data.quest.AllCountriesExcept | ||
|
||
val LGBTExcludedCountries = AllCountriesExcept( | ||
listOf( | ||
"AF", | ||
"DZ", | ||
"AO", | ||
"AG", | ||
"BD", | ||
"BB", | ||
"BI", | ||
"CM", | ||
"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 |
||
"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, | ||
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,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" | ||
} | ||
} | ||
} |
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.
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.
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.
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?
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.
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)