Skip to content

Commit

Permalink
show also disused shops when showing shoplike
Browse files Browse the repository at this point in the history
disused shops that re correctly tagged are useful for orientation

disused shops that incorrectly tagged may be also present but
- it may cause user to report issue in OSM data
- SC is not supporting invalid data (like disused:shop=* used when there is no trace of shop anymore)

discussed in streetcomplete#3719
  • Loading branch information
matkoniecz committed Feb 7, 2022
1 parent 0ee19b0 commit 0010c16
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class AddHalal : OsmFilterQuestType<DietAvailabilityAnswer>() {
override fun getTitle(tags: Map<String, String>) = R.string.quest_dietType_halal_name_title

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_halal)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class AddKosher : OsmFilterQuestType<DietAvailabilityAnswer>() {
override fun getTitle(tags: Map<String, String>) = R.string.quest_dietType_kosher_name_title

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_kosher)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class AddVegan : OsmFilterQuestType<DietAvailabilityAnswer>() {
override fun getTitle(tags: Map<String, String>) = R.string.quest_dietType_vegan_name_title

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_vegan)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class AddVegetarian : OsmFilterQuestType<DietAvailabilityAnswer>() {
override fun getTitle(tags: Map<String, String>) = R.string.quest_dietType_vegetarian_name_title

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_vegetarian)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ class AddOpeningHours(
}

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddOpeningHoursForm()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class CheckOpeningHoursSigned (
filter.matches(element) && hasName(element.tags)

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = YesNoQuestAnswerFragment()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class AddPlaceName(
filter.matches(element) && hasFeatureName(element.tags)

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddPlaceNameForm()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class CheckShopType : OsmElementQuestType<ShopTypeAnswer> {
disusedShopsFilter.matches(element) && !shopsFilter.matches(element)

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = ShopTypeForm()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class SpecifyShopType : OsmFilterQuestType<ShopTypeAnswer>() {
}

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = ShopTypeForm()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ class AddWheelchairAccessBusiness(
}

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes, ways, relations with " + isKindOfShopExpression())
getMapData().filter("nodes, ways, relations with " +
isKindOfShopExpression() + " or " + isKindOfShopExpression("disused")
)

override fun createForm() = AddWheelchairAccessBusinessForm()

Expand Down

0 comments on commit 0010c16

Please sign in to comment.