Ticket #17172: turn_lanes.patch

File turn_lanes.patch, 2.5 KB (added by taylor.smock, 2 years ago)

mapcss checks for bad data

  • data/validator/highway.mapcss

     
    140140  throwWarning: tr("railway crossing without {0}", "{0.tag}");
    141141  group: tr("missing tag");
    142142  fixAdd: "railway=level_crossing";
    143 }
    144  No newline at end of file
     143}
     144
     145way[highway][turn:lanes][turn:lanes:forward],
     146way[highway][turn:lanes][turn:lanes:backward] {
     147  throwError: tr("turn:lanes and a directional turn:lanes");
     148  assertMatch: "way highway=primary turn:lanes=through turn:lanes:forward=left";
     149  assertMatch: "way highway=primary turn:lanes=through turn:lanes:backward=left";
     150  assertNoMatch: "way highway=primary turn:lanes:forward=left";
     151  assertNoMatch: "way highway=primary turn:lanes:backward=left";
     152  assertNoMatch: "way highway=primary turn:lanes=through";
     153}
     154way[highway][turn:lanes][oneway][count(split("|", tag("turn:lanes"))) != tag("lanes")],
     155way[highway][turn:lanes][!oneway][2 * count(split("|", tag("turn:lanes"))) != tag("lanes")],
     156way[highway][turn:lanes][!lanes] {
     157  throwWarning: tr("turn:lanes do not match lanes");
     158  assertMatch: "way highway=primary lanes=4 turn:lanes=left|through|through;right";
     159  assertNoMatch: "way highway=primary lanes=4 turn:lanes=left;through|through;right";
     160}
     161
     162way[highway][turn:lanes:forward][lanes:forward][count(split("|", tag("turn:lanes:forward"))) != tag("lanes:forward")],
     163way[highway][turn:lanes:forward][!lanes:forward][count(split("|", tag("turn:lanes:forward"))) != tag("lanes") / 2],
     164way[highway][turn:lanes:forward][!lanes][!lanes:forward] {
     165  throwWarning: tr("turn:lanes:forward do not match lanes:forward");
     166  assertMatch: "way highway=primary lanes:forward=4 turn:lanes:forward=left|through|through;right";
     167  assertNoMatch: "way highway=primary lanes:forward=4 turn:lanes:forward=left;through|through;right";
     168}
     169
     170way[highway][turn:lanes:backward][lanes:backward][count(split("|", tag("turn:lanes:backward"))) != tag("lanes:backward")],
     171way[highway][turn:lanes:backward][!lanes:backward][count(split("|", tag("turn:lanes:backward"))) != tag("lanes") / 2],
     172way[highway][turn:lanes:backward][!lanes][!lanes:backward] {
     173  throwWarning: tr("turn:lanes:backward do not match lanes:backward");
     174  assertMatch: "way highway=primary lanes:backward=4 turn:lanes:backward=left|through|through;right";
     175  assertNoMatch: "way highway=primary lanes:backward=4 turn:lanes:backward=left;through|through;right";
     176}