source: josm/trunk/data/validator/highway.mapcss

Last change on this file was 14354, checked in by Klumbumbus, 6 months ago

fix #16873 - add a warning about highway=yes

  • Property svn:eol-style set to native
File size: 6.0 KB
RevLine 
[7281]1way[highway=~/^(motorway|trunk|primary|secondary|tertiary)$/] {
[6601]2  set major_road;
3}
[7281]4way[highway=~/^.*_link$/] {
5  set link_road;
6}
[6601]7way[highway=~/^(unclassified|residential|living_street|service)$/] {
8  set minor_road;
9}
10
[6874]11way[highway][name =~ /(?i).* (Ave|Blvd|Br|Brg|Cct|Cir|Cl|Cr|Crct|Cres|Crt|Ct|Dr|Drv|Esp|Espl|Hwy|Ln|Mw|Mwy|Pky|Pkwy|Pl|Rd|Qy|Qys|Sq|St|Str|Ter|Tce|Tr|Wy)[.]?$/] {
[6513]12  throwWarning: tr("abbreviated street name");
13  assertMatch: "way highway=unclassified name=\"Foo Ave\"";
14  assertMatch: "way highway=unclassified name=\"Foo Ave.\"";
15  assertMatch: "way highway=unclassified name=\"Bou Blvd.\"";
16  assertMatch: "way highway=unclassified name=\"Bou blvd.\"";
17}
18
[11050]19node[highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|track|path|footway|cycleway|bus_guideway|bridleway/][highway!=motorway_junction][highway!=services] {
[6513]20  throwWarning: tr("wrong highway tag on a node");
21  assertMatch: "node highway=primary";
22  assertMatch: "node highway=primary_link";
[6516]23  assertNoMatch: "node highway=traffic_calming";
24  assertNoMatch: "node highway=bus_stop";
[6513]25  assertNoMatch: "node highway=crossing";
[6516]26  assertNoMatch: "node highway=emergency_access_point";
27  assertNoMatch: "node highway=give_way";
28  assertNoMatch: "node highway=mini_roundabout";
29  assertNoMatch: "node highway=motorway_junction";
30  assertNoMatch: "node highway=passing_place";
31  assertNoMatch: "node highway=rest_area";
32  assertNoMatch: "node highway=speed_camera";
33  assertNoMatch: "node highway=street_lamp";
34  assertNoMatch: "node highway=services";
35  assertNoMatch: "node highway=stop";
36  assertNoMatch: "node highway=traffic_signals";
37  assertNoMatch: "node highway=turning_circle";
[6513]38}
39
[7977]40way[highway=crossing],
41way[railway=crossing],
42way[railway=level_crossing] {
[6513]43  throwWarning: tr("wrong crossing tag on a way");
44  assertMatch: "way highway=crossing";
45  assertNoMatch: "node highway=crossing";
46}
47
[7932]48way[highway=unclassified][!name][noname!=yes] {
[6513]49  throwOther: tr("Unnamed unclassified highway");
50  assertMatch: "way highway=unclassified";
[7932]51  assertNoMatch: "way highway=unclassified noname=yes";
[6513]52  assertNoMatch: "way highway=unclassified name=Foo";
53}
54
[13471]55way.major_road[!ref][!destination:ref][noref!=yes][junction!=roundabout] {
[6513]56  throwOther: tr("highway without a reference");
[11146]57  group: tr("missing tag");
[6513]58  assertMatch: "way highway=primary";
59  assertNoMatch: "way highway=primary ref=123";
[11337]60  assertNoMatch: "way highway=primary destination:ref=123";
[12194]61  assertNoMatch: "way highway=primary noref=yes";
[6513]62}
63
[14354]64way[highway=yes],
[6513]65way[highway=road] {
[12418]66  throwWarning: tr("Unspecific highway type");
[6513]67  assertMatch: "way highway=road";
68  assertNoMatch: "way highway=residential";
69}
70
[6550]71way[highway=footway][maxspeed],
72way[highway=steps][maxspeed],
[7819]73way[highway=cycleway][bicycle=no],
74way[highway=footway][foot=no],
[6550]75way[highway=cycleway][cycleway=lane] {
76  throwWarning: tr("{0} used with {1}", "{0.value}", "{1.tag}");
[6513]77  assertNoMatch: "way highway=cycleway bicycle=yes";
78  assertNoMatch: "way highway=cycleway";
79  assertNoMatch: "way highway=footway foot=yes";
80  assertNoMatch: "way highway=footway";
81  assertMatch: "way highway=cycleway cycleway=lane";
82  assertNoMatch: "way highway=cycleway";
83  assertNoMatch: "way highway=residential cycleway=lane";
84  assertMatch: "way highway=footway maxspeed=20";
85  assertNoMatch: "way highway=residential maxspeed=20";
86  assertNoMatch: "way highway=footway";
87}
88
[13005]89/* footway, see #10851, #10976, #15439 */
90way[footway=left][/^footway:/],
91way[footway=right][/^footway:/],
92way[footway=both][/^footway:/],
93way[footway=no][/^footway:/] {
[11364]94  throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk", "{1.key}");
95  group: tr("deprecated tagging");
96  set not_fixable_footway;
97  assertMatch: "way footway=both footway:surface=asphalt";
98}
99way[footway=none][/footway:/] {
100  throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk=no", "{1.key}");
101  group: tr("deprecated tagging");
102  set not_fixable_footway;
103}
104way[footway=left]!.not_fixable_footway,
105way[footway=right]!.not_fixable_footway,
106way[footway=both]!.not_fixable_footway,
107way[footway=no]!.not_fixable_footway {
[7814]108  throwWarning: tr("{0} is deprecated", "{0.tag}");
109  suggestAlternative: "sidewalk";
[11139]110  group: tr("deprecated tagging");
[7814]111  fixChangeKey: "footway => sidewalk";
[11364]112  set fixable_footway;
[7814]113}
[11364]114way[footway=none]!.not_fixable_footway {
[7814]115  throwWarning: tr("{0} is deprecated", "{0.tag}");
116  suggestAlternative: "sidewalk=no";
[11139]117  group: tr("deprecated tagging");
[7814]118  fixRemove: "footway";
119  fixAdd: "sidewalk=no";
[11364]120  set fixable_footway;
[7814]121}
[11364]122way[footway][footway!=sidewalk][footway!=crossing]!.fixable_footway!.not_fixable_footway { /* do not trigger this rule if already one of the 4 previous rules applied */
[7814]123  throwWarning: tr("Value of ''{0}'' should either be ''{1}'' or ''{2}''. For sidewalks use ''{3}'' instead.", "{0.key}", "{1.value}", "{2.value}", "sidewalk=left|right|both|no");
[11049]124  assertNoMatch: "way footway=left";
125  assertNoMatch: "way footway=none";
[11364]126  assertNoMatch: "way footway=left footway:left:surface=asphalt";
[11049]127  assertMatch: "way footway=bar";
[9839]128}
129
[13977]130/* #11270, #9297, #15439, #16424 */
[12895]131way[railway =~ /^(light_rail|miniature|narrow_gauge|preserved|rail)$/][!highway] > node { set .is_in_railway }
[12595]132way[highway =~ /^(bridleway|cycleway|footway|path|steps)$/] > node { set .is_in_minor_road }
[13005]133way[highway =~ /^(bus_guideway|living_street|motorway|motorway_link|pedestrian|primary|primary_link|raceway|residential|road|secondary|secondary_link|service|tertiary|tertiary_link|track|trunk|trunk_link|unclassified)$/] > node { set .is_in_major_road }
[13977]134node[railway!=crossing][crossing!=no].is_in_railway.is_in_minor_road!.is_in_major_road {
[9839]135  throwWarning: tr("pedestrian railway crossing without {0}", "{0.tag}");
[11146]136  group: tr("missing tag");
[9839]137  fixAdd: "railway=crossing";
138}
[12595]139node[railway!=level_crossing].is_in_railway.is_in_major_road!.is_in_minor_road {
[9839]140  throwWarning: tr("railway crossing without {0}", "{0.tag}");
[11146]141  group: tr("missing tag");
[9839]142  fixAdd: "railway=level_crossing";
[7814]143}
Note: See TracBrowser for help on using the repository browser.