Skip to content

Commit

Permalink
street furniture overlay (#5373)
Browse files Browse the repository at this point in the history
* street furniture overlay

fixes #4912

* add hiunting stand

* remove unused method

* fix typo

* refactoring popular shops

* add amenity=bicycle_wash

* lifecycle prefix handler

* try to reconstruct from lifecycle prefix

* simplify syntax

Co-authored-by: Flo Edelmann <[email protected]>

* fix syntax error

Co-authored-by: Flo Edelmann <[email protected]>

* add values from systematic taginfo review

* better marker

* group strings

* support table_soccer tables

yes, no effect right now as it is missing from iD presets

* move unit test

* use bench as overlay icon

* remove unnecessary suspend function

* use "plus" icon for adding a street furniture poi

* Features without a dedicated icon shall fall back to a generic marker icon

* remove duplicate

* add comments about the number of usages

* fix broken prefix

* fix map display

* better handle objects not in presets

* man mades together

* show also natural=spring as other water source features are shown

* fix merge

* refactor handling of disused

* sort features alphabetically (consistent with Shop.kt)

* for added features, the geometry type is always POINT

* Extend "shops" category to "places" category (fixes #5152)

* add many street furniture POIs

* rename Shop to Place

* review list of quick-select features

* reorder overlays so that street furniture is next to shops

* add delete node answer

* include a few more things

* do not allow editing features

* add playground equipment

* use dot icon

* rename StreetFurniture to "Thing"

* rename StreetFurniture to "Thing"

* simplify edit creation (because modification of feature is disabled)

* remove unused imports

---------

Co-authored-by: Tobias Zwick <[email protected]>
Co-authored-by: Flo Edelmann <[email protected]>
  • Loading branch information
3 people authored Feb 14, 2024
1 parent 9b7e833 commit cb1ef5a
Show file tree
Hide file tree
Showing 59 changed files with 1,095 additions and 493 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ interface OsmElementQuestType<T> : QuestType, ElementEditType {
* elements that are expected to be some kind of shop/amenity should be replaceable this way,
* i.e. anything that when it's gone, there is a vacant shop then.
* */
val isReplaceShopEnabled: Boolean get() = false
val isReplacePlaceEnabled: Boolean get() = false

override val title: Int get() = getTitle(emptyMap())

Expand Down
21 changes: 21 additions & 0 deletions app/src/main/java/de/westnordost/streetcomplete/osm/Lifecycle.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.westnordost.streetcomplete.osm

import de.westnordost.streetcomplete.data.osm.mapdata.Element
import de.westnordost.streetcomplete.util.ktx.copy

/** Returns a copy of this element with all tags prefixed with the given [lifecycle] prefix moved
* to normal tags space and all others cleared.
* Returns `null` if the element has no tags with the given [lifecycle] prefix
*
* E.g. when calling this method with [lifecycle] = "disused" for an element with the tags
* `building=yes` + `disused:shop=yes` , a copy of that element is returned with the only tag
* `shop=yes`. */
fun Element.asIfItWasnt(lifecycle: String): Element? =
if (tags.hasPrefixed(lifecycle)) copy(tags = tags.getPrefixedOnly(lifecycle)) else null

private fun Map<String, String>.hasPrefixed(prefix: String): Boolean =
any { it.key.startsWith("$prefix:") }

private fun Map<String, String>.getPrefixedOnly(prefix: String): Map<String, String> = this
.filter { it.key.startsWith("$prefix:") }
.mapKeys { it.key.substring(prefix.length + 1) }
Loading

0 comments on commit cb1ef5a

Please sign in to comment.