From 9c04ff06348c30e7a6df3e67b4f48bfcde98b44a Mon Sep 17 00:00:00 2001 From: "taylor.smock" Date: Mon, 5 Aug 2024 16:40:38 +0000 Subject: [PATCH] Fix #21801: Add railway junction check for missing switches and crossings (patch by gaben) Additional notes: If a mapper has left non-existent railways in OSM, then this will produce false positives. With that said, non-existent railways don't belong in OSM. git-svn-id: https://josm.openstreetmap.de/svn/trunk@19163 0c6e7542-c601-0410-84e7-c038aed88b3b --- resources/data/validator/geometry.mapcss | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/data/validator/geometry.mapcss b/resources/data/validator/geometry.mapcss index de43241551d..7aba8e44cac 100644 --- a/resources/data/validator/geometry.mapcss +++ b/resources/data/validator/geometry.mapcss @@ -282,8 +282,6 @@ node:unconnected:in-downloaded-area[railway=buffer_stop], node:unconnected:in-downloaded-area[railway=crossing], node:unconnected:in-downloaded-area[railway=level_crossing], node:unconnected:in-downloaded-area[railway=milestone], -node:unconnected:in-downloaded-area[railway=railway_crossing], -node:unconnected:in-downloaded-area[railway=switch], node:unconnected:in-downloaded-area[public_transport=stop_position], node:unconnected:in-downloaded-area[aeroway=holding_position], node:unconnected:in-downloaded-area[noexit], @@ -424,3 +422,18 @@ way[route=ferry]!:closed >[index= 1] node[amenity!=ferry_terminal][man_made!=pie way[route=ferry]!:closed >[index=-1] node[amenity!=ferry_terminal][man_made!=pier]!.node_in_terminal_pier!.node_in_ferry_bridge_tunnel:in-downloaded-area { throwWarning: tr("Ferry route is not connected to a ferry terminal or branches."); } + +/* #21801 */ +way[railway][railway !~ /^(turntable|traverser|roundhouse|workshop|platform)$/] > node[/railway$/ !~ /^(switch|railway_crossing)$/][count(parent_osm_primitives("railway")) > 2]:connection, +way[railway][railway !~ /^(turntable|traverser|roundhouse|workshop|platform)$/] >[index!=1][index!=-1] node[/railway$/ !~ /^(switch|railway_crossing)$/][count(parent_osm_primitives("railway")) == 2]:connection { + set missing_switch_railway_crossing; +} +node.missing_switch_railway_crossing { + throwWarning: tr("Railways connection node without {0} or {1}", "railway=switch", "railway=railway_crossing"); + group: tr("missing tag"); +} +node[railway=railway_crossing]!:connection:in-downloaded-area, +node[railway=switch]!:connection:in-downloaded-area { + throwWarning: tr("{0}", "{0.tag}"); + group: tr("Node should be connected to two or more ways"); +}