Skip to content

Commit

Permalink
Fix #21801: Add railway junction check for missing switches and cross…
Browse files Browse the repository at this point in the history
…ings (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
  • Loading branch information
taylor.smock committed Aug 5, 2024
1 parent 11736eb commit 9c04ff0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions resources/data/validator/geometry.mapcss
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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");
}

0 comments on commit 9c04ff0

Please sign in to comment.