Changeset 11146 in josm for trunk/data/validator


Ignore:
Timestamp:
2016-10-18T20:32:20+02:00 (3 years ago)
Author:
Klumbumbus
Message:

see #13804 - a bit more grouping in the validator tree, small adjustments to a few validator rules

Location:
trunk/data/validator
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/combinations.mapcss

    r11133 r11146  
    7777*[source:maxspeed              ][!/^maxspeed:?/] {
    7878  throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
     79  group: tr("missing tag");
    7980  assertMatch: "way lanes=42";
    8081  assertNoMatch: "way lanes=42 highway=unclassified";
     
    9091*[leaf_cycle][!leaf_type] {
    9192  throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
     93  group: tr("missing tag");
    9294}
    9395
     
    109111*[bunker_type                  ][military!=bunker] {
    110112  throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
     113  group: tr("missing tag");
    111114}
    112115
     
    115118*[reservoir_type               ][landuse!=reservoir][water!=reservoir] {
    116119  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.tag}", "{2.tag}");
     120  group: tr("missing tag");
    117121}
    118122
     
    129133*[amenity=place_of_worship][!religion] {
    130134  throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
     135  group: tr("missing tag");
    131136}
    132137
     
    144149*[amenity=parking_entrance     ][!parking] {
    145150  throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
     151  group: tr("missing tag");
    146152  assertMatch: "way power=line";
    147153  assertNoMatch: "way power=line voltage=1";
     
    158164way[oneway][!highway][!railway] {
    159165  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
     166  group: tr("missing tag");
    160167}
    161168
     
    164171*[segregated                   ][!highway][railway!=crossing] {
    165172  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
     173  group: tr("missing tag");
    166174}
    167175
     
    170178*[highway=motorway_link][!oneway][junction!=roundabout] {
    171179  throwOther: tr("{0} without {1}", "{0.tag}", "{1.tag}");
     180  group: tr("missing tag");
    172181}
    173182
     
    175184*[amenity=recycling][recycling_type!=container][recycling_type!=centre] {
    176185  throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.tag}");
     186  group: tr("missing tag");
    177187}
    178188
     
    181191*[boat                         ][!waterway][natural!=water][landuse!=basin] {
    182192  throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}");
     193  group: tr("missing tag");
    183194}
    184195
     
    186197*[snowplowing                  ][!highway][!amenity][!leisure] {
    187198  throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
     199  group: tr("missing tag");
    188200}
    189201
     
    192204*[toll                         ][!highway][!barrier][route!~/^(ferry|road)$/] {
    193205  throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
     206  group: tr("missing tag");
    194207}
    195208
     
    197210*[noname?][name] {
    198211  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
     212  group: tr("suspicious tag combination");
    199213}
    200214
     
    205219way[oneway=-1 ][/:forward/][!traffic_sign:forward][bicycle:forward!=use_sidepath] {
    206220  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
     221  group: tr("suspicious tag combination");
    207222}
    208223
     
    210225*[highway=footway][oneway=no] {
    211226  throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
     227  group: tr("suspicious tag combination");
    212228}
    213229
     
    215231*[highway=footway][bicycle=designated] {
    216232  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
     233  group: tr("suspicious tag combination");
    217234}
    218235
     
    221238  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
    222239  suggestAlternative: "bridge=aqueduct";
     240  group: tr("suspicious tag combination");
    223241  fixAdd: "bridge=aqueduct";
    224242}
     
    228246  suggestAlternative: "waterway=dam";
    229247  suggestAlternative: tr("two objects, one with {0} and one with {1} + {2} + {3}", "{0.tag}", "{2.key}", "{1.tag}", "layer");
     248  group: tr("suspicious tag combination");
    230249}
    231250
     
    236255*[lit][eval(number_of_tags()) = 1] {
    237256  throwWarning: tr("incomplete object: only {0}", "{0.key}");
     257  group: tr("missing tag");
    238258}
    239259/* only {0.key} and {1.key}, see #11104 */
     
    241261*[name][ref][eval(number_of_tags()) = 2] {
    242262  throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
     263  group: tr("missing tag");
    243264}
    244265
     
    248269*[highway][/^addr:/][highway!=services][highway!=rest_area][!"addr:postcode"] {
    249270  throwWarning: tr("{0} together with addr:*", "{0.key}");
     271  group: tr("suspicious tag combination");
    250272}
    251273*[!highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
    252274  throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
     275  group: tr("suspicious tag combination");
    253276}
    254277*[!highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
    255278  throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
     279  group: tr("suspicious tag combination");
    256280}
    257281way[highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
    258282  throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
     283  group: tr("suspicious tag combination");
    259284  fixRemove: "addr:postcode";
    260285}
    261286way[highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
    262287  throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
     288  group: tr("suspicious tag combination");
    263289}
    264290way[highway][highway!=services][highway!=rest_area][!postal_code]["addr:postcode"] {
    265291  throwWarning: tr("{0} together with {1}", "{0.key}", "{4.key}");
    266292  suggestAlternative: "postal_code";
     293  group: tr("suspicious tag combination");
    267294  fixChangeKey: "addr:postcode=>postal_code";
    268295}
     
    272299  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
    273300  suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
     301  group: tr("suspicious tag combination");
    274302}
    275303
     
    281309*[maxspeed][!highway][!railway][traffic_sign !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type != enforcement][waterway !~ /^(river|canal|lock)$/][!traffic_calming] {
    282310  throwWarning: tr("{0} on suspicious object", "{0.key}");
    283 }
    284 
    285 node[amenity =~ /^(restaurant|cafe|fast_food)$/][!name][noname!=yes] {
    286   throwOther: tr("restaurant without name");
     311  group: tr("suspicious tag combination");
     312}
     313
     314node[amenity][amenity =~ /^(restaurant|cafe|fast_food)$/][!name][noname!=yes] {
     315  throwOther: tr("{0} without {1}", "{0.tag}", "{2.key}");
     316  group: tr("missing tag");
    287317  assertMatch: "node amenity=restaurant";
    288318  assertNoMatch: "node amenity=restaurant noname=yes";
     
    294324way[highway][natural],
    295325*[landuse][building] {
    296   throwWarning: tr("{0} used with {1}", "{0.key}", "{1.key}");
     326  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
     327  group: tr("suspicious tag combination");
    297328  assertNoMatch: "node highway=street_lamp natural=birds_nest note=josm#10193";
    298329}
     
    301332*[natural=water][leisure=swimming_pool] {
    302333  throwWarning: tr("natural water used for swimming pool");
     334  group: tr("suspicious tag combination");
    303335  fixRemove: "natural";
    304336}
     
    307339*[sport][!building][!club][tourism != hotel][highway != raceway][leisure !~ /^(sports_centre|stadium|track|pitch|golf_course|water_park|swimming_pool|recreation_ground|ice_rink|horse_riding)$/][natural !~ /^(beach|bare_rock|cliff|peak|water)$/][amenity !~ /^(pub|restaurant|swimming_pool)$/][landuse !~ /^(recreation_ground|piste|farm|farmland)$/][barrier !~ /^(wall|retaining_wall)$/][!"piste:type"][shop!=sports] {
    308340    throwWarning: tr("sport without physical feature");
     341    group: tr("missing tag");
    309342    assertMatch: "node sport=tennis";
    310343    assertNoMatch: "node sport=tennis leisure=pitch";
     
    318351*[building:levels][!building][!building:part] {
    319352  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
    320 }
    321 
    322 /* #10471 */
    323 way[waterway] > node[ford?] { set ford_on_waterway; }
    324 way[highway] > node[ford?] { set ford_on_highway; }
    325 node[ford?]:in-downloaded-area!.ford_on_waterway, node[ford?]:in-downloaded-area!.ford_on_highway {
    326     throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
     353  group: tr("missing tag");
    327354}
    328355
     
    330357*[/_name$/][!name][!old_name][!loc_name][!uic_name][!artist_name][!"osak:municipality_name"][!"osak:street_name"][noname!=yes] {
    331358  throwWarning: tr("alternative name without {0}", "{1.key}");
     359  group: tr("missing tag");
    332360}
    333361
     
    343371  throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
    344372  suggestAlternative: "maxspeed";
     373  group: tr("suspicious tag combination");
    345374  fixChangeKey: "maxspeed:forward=>maxspeed";
    346375  fixRemove: "maxspeed:backward";
     
    350379  set AllSameMaxspeed;
    351380  suggestAlternative: "maxspeed";
     381  group: tr("suspicious tag combination");
    352382  fixRemove: "maxspeed:forward";
    353383  fixRemove: "maxspeed:backward";
     
    355385way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed {
    356386  throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
     387  group: tr("suspicious tag combination");
    357388}
    358389way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
    359390way["maxspeed:backward"][maxspeed][!"maxspeed:forward"] {
    360391  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
     392  group: tr("suspicious tag combination");
    361393}
    362394
     
    364396way[layer][layer<0][bridge][bridge!=no][location!=underground][indoor!=yes][!tunnel],
    365397way[layer][layer>0][tunnel][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
    366   throwWarning: tr("Suspicious tag combination: {0} and {1}", "{2.tag}", "{0.tag}");
     398  throwWarning: tr("{0} together with {1}", "{2.tag}", "{0.tag}");
     399  group: tr("suspicious tag combination");
    367400}
    368401
     
    375408way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
    376409  throwWarning: tr("Long waterway with {0} but without a tag which defines it as tunnel or underground. Remove {1} or add a tunnel tag if applicable. Also check crossing bridges and their {1} tags.", "{1.tag}", "{1.key}");
     410  group: tr("suspicious tag combination");
    377411}
    378412way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
    379413  throwOther: tr("Short waterway with {0} but without a tag which defines it as tunnel or underground. Remove {1} or add a tunnel tag if applicable. Also check crossing bridges and their {1} tags.", "{1.tag}", "{1.key}");
     414  group: tr("suspicious tag combination");
    380415}
    381416
     
    384419*[unisex=yes][male=yes][female!=yes] {
    385420  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
     421  group: tr("suspicious tag combination");
    386422}
    387423*[unisex=yes][female=yes][male=yes] {
    388424  throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
     425  group: tr("suspicious tag combination");
    389426  fixRemove: "female";
    390427  fixRemove: "male";
     
    393430  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
    394431  suggestAlternative: "unisex=yes";
     432  group: tr("suspicious tag combination");
    395433  fixRemove: "female";
    396434  fixRemove: "male";
     
    401439area:closed[water][natural!=water][water!=intermittent] { /* water=intermittent is deprecated and has an own warning */
    402440  throwWarning: tr("{0} without {1}", "{1.key}", "{2.tag}");
     441  group: tr("missing tag");
    403442  fixAdd: "natural=water";
    404443}
    405444way!:closed[water][natural!=water][water!=intermittent] {
    406445  throwWarning: tr("{0} without {1}", "{1.key}", "{2.tag}");
     446  group: tr("missing tag");
    407447}
    408448
     
    416456way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:symbol:lanes][tag(lanes)!=eval(count(split("|", tag("destination:symbol:lanes"))))] {
    417457    throwWarning: tr("Different number of lanes in the keys {0} and {1}", "{1.key}", "{2.key}");
     458    group: tr("suspicious tag combination");
    418459}
    419460
     
    423464  suggestAlternative: "natural=sand";
    424465  suggestAlternative: "surface=sand";
     466  group: tr("suspicious tag combination");
    425467}
    426468
     
    431473way["addr:housenumber"][!building][!"building:part"][!"demolished:building"][!note][!amenity][!leisure][!landuse][!man_made][!tourism][!barrier]!.part_of_building_MP {
    432474  /* don't exclude shop because a lot of real missing bulding tag cases have a shop tag. */
    433   throwOther: tr("Suspicious object: possibly missing {0} tag.", "{1.key}");
    434 }
     475  throwOther: tr("possibly missing {0} tag", "{1.key}");
     476  group: tr("missing tag");
     477}
  • trunk/data/validator/deprecated.mapcss

    r11138 r11146  
    929929/* #12494 */
    930930*[/^[^t][^i][^g].+_[0-9]$/][!/^note_[0-9]$/][!/^description_[0-9]$/] {
    931   throwOther: tr("questionable key (ending with a number): {0}", "{0.key}");
     931  throwOther: tr("{0}", "{0.key}");
     932  group: tr("questionable key (ending with a number)");
    932933  assertMatch: "way name_1=foo";
    933934  assertNoMatch: "way note_2=foo";
  • trunk/data/validator/geometry.mapcss

    r11138 r11146  
    103103node[leisure=park][natural=tree] {
    104104  throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
     105  group: tr("suspicious tag combination");
    105106  fixRemove: "leisure";
    106107}
     
    289290  throwError: tr("Coastline inside {1}", "{0.tag}");
    290291}
     292
     293/* #10471 */
     294way[waterway] > node[ford?] { set ford_on_waterway; }
     295way[highway] > node[ford?] { set ford_on_highway; }
     296node[ford?]:in-downloaded-area!.ford_on_waterway, node[ford?]:in-downloaded-area!.ford_on_highway {
     297    throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
     298}
  • trunk/data/validator/highway.mapcss

    r11139 r11146  
    5555way.major_road[!ref] {
    5656  throwOther: tr("highway without a reference");
     57  group: tr("missing tag");
    5758  assertMatch: "way highway=primary";
    5859  assertNoMatch: "way highway=primary ref=123";
     
    120121way[highway =~ /^(bridleway|cycleway|footway|path|steps)$/] > node[railway != crossing].is_in_railway {
    121122  throwWarning: tr("pedestrian railway crossing without {0}", "{0.tag}");
     123  group: tr("missing tag");
    122124  fixAdd: "railway=crossing";
    123125}
    124126way[highway =~ /^(bus_guideway|living_street|motorway|pedestrian|primary|raceway|residential|road|secondary|service|tertiary|track|trunk|unclassified)/] > node[railway != level_crossing].is_in_railway {
    125127  throwWarning: tr("railway crossing without {0}", "{0.tag}");
     128  group: tr("missing tag");
    126129  fixAdd: "railway=level_crossing";
    127130}
  • trunk/data/validator/relation.mapcss

    r8523 r11146  
    1717relation[type=enforcement][!enforcement] {
    1818  throwWarning: tr("{0} relation without {0} tag", "{1.key}");
     19  group: tr("missing tag");
    1920  assertMatch: "relation type=route";
    2021  assertNoMatch: "relation type=route route=train";
  • trunk/data/validator/religion.mapcss

    r9729 r11146  
    33*[religion =~ /^(christian|jewish|muslim)$/][!denomination] {
    44  throwOther: tr("religion without denomination");
     5  group: tr("missing tag");
    56  assertMatch: "node religion=christian";
    67  assertNoMatch: "node religion=christian denomination=catholic";
  • trunk/data/validator/unnecessary.mapcss

    r9541 r11146  
    2525*[emergency=permissive] {
    2626  /* see #9458 - emergency=permissive makes no sense */
    27   throwWarning: tr("{0}={1} makes no sense", "emergency", "permissive");
     27  throwWarning: tr("{0} makes no sense", "{0.tag");
    2828  fixAdd: "emergency=yes";
    2929  assertMatch: "way emergency=permissive";
  • trunk/data/validator/wikipedia.mapcss

    r7937 r11146  
    1919  throwWarning: tr("deprecated format for wikipedia tag");
    2020  suggestAlternative: tr("''wikipedia''=''language:page title''");
     21  group: tr("deprecated tagging");
    2122  assertMatch: "node wikipedia=http://en.wikipedia.org/wiki/OpenStreetMap";
    2223  assertNoMatch: "node wikipedia=en:OpenStreetMap";
Note: See TracChangeset for help on using the changeset viewer.