Skip to content

Commit

Permalink
Refinements for amenity_indoor element filtering
Browse files Browse the repository at this point in the history
- Do not ask for amenities in a polygon of type building=roof
- always ask for aed (no is-inside-building-polygon-filtering)
  • Loading branch information
qugebert authored Oct 27, 2023
1 parent 661c54b commit 165f6db
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ class AddIsAmenityIndoor(private val getFeature: (tags: Map<String, String>) ->
""".toElementFilterExpression() }

/* We only want survey nodes within building outlines. */
// exclude building=roof, see https://github.com/streetcomplete/StreetComplete/issues/5333
private val buildingFilter by lazy { """
ways, relations with building
ways, relations with
building
and building != roof
""".toElementFilterExpression() }

override val changesetComment = "Determine whether amenities are inside buildings"
Expand Down Expand Up @@ -65,6 +68,10 @@ class AddIsAmenityIndoor(private val getFeature: (tags: Map<String, String>) ->

// Reduce all matching nodes to nodes within building outlines
val nodesInBuildings = nodes.filter {
// always ask for aed, see: https://github.com/streetcomplete/StreetComplete/issues/5336
if (it.tags["emergency"] == "defibrillator") {
true
}
buildings.any { building ->
val buildingGeometry = buildingGeometriesById[building.id]

Expand Down

0 comments on commit 165f6db

Please sign in to comment.