source: josm/trunk/data/validator/tagchecker.cfg @ 6532

Last change on this file since 6532 was 6532, checked in by Don-vip, 10 years ago

fix #8687, see #9414, see #9470 - tagchecker: update numeric tests to new MapCSS format, with embedded unit tests. MapCSS syntax updated a bit for regex.

  • Property svn:eol-style set to native
File size: 19.3 KB
Line 
1# JOSM TagChecker validator file
2
3# Format:
4# Each line specifies a certain error to be reported
5# <data type> : messagetype : <key><expression><value>
6# Lines starting with a # are considered as comments.
7#
8# Data type can be:
9#  node        - a node point
10#  way         - a way
11#  relation    - a relation
12#  *           - all data types
13#
14# Message type can be:
15# E            - an error
16# W            - a warning
17# I            - an low priority informational warning
18#
19# Key and value are expressions describing certain keys and values of these keys.
20# Regular expressions are supported. In this case the expressions starts and
21# ends with a / sign. If an 'i' is appended, the regular expression is
22# case insensitive. For instance, /foo|bar/i
23#
24# The * sign indicates any string.
25# The texts BOOLEAN_TRUE and BOOLEAN_FALSE in the value part indicate a special
26# handling for boolean values (yes, true, 0, false, no, ...).
27#
28# Expression can be:
29#  !=          - the key/value combination does not match
30#  ==          - the key/value combination does match
31#
32# To have more complicated expressions, multiple elements can be grouped together
33# with an logical and (&&).
34#
35# The comment at the end of a rule is displayed in validator description
36#
37# Empty lines and space signs are ignored
38
39*    : W : / *name */i == * && name != *                                       # misspelled key name
40
41# The following could replace unnamed way check. Still at the moment we keep it as it is
42#way  : W : junction == roundabout && highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed junction
43#way  : W : highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed
44
45# see #5844, #6760
46#way  : W : oneway != BOOLEAN_FALSE && /.*:(backward|forward)/ == *    # oneway combined with *:backward/forward
47
48relation : E : type != *                                       # relation without type
49
50node : I : amenity == /restaurant|cafe|fast_food/ && name != * # restaurant without name
51#way  : I : highway != * && railway != * && waterway != * && name == * # unusual named way type
52#*    : W : natural == water && waterway == *                   # unusual tag combination (natural=water & waterway)
53*    : W : highway == * && waterway == * && waterway != dam    # unusual tag combination (highway & waterway)
54*    : W : highway == * && natural == *                        # unusual tag combination (highway & natural)
55*    : W : landuse == * && building == *                       # unusual tag combination (landuse & building)
56
57*    : W : highway == proposed && access == *                  # unnecessary access key
58*    : W : highway == /motorway*|trunk*|primary*|secondary*|tertiary*|unclassified|residential|service|living_street/ && motor_vehicle == BOOLEAN_TRUE # unnecessary motor_vehicle=yes
59
60*    : W : natural == water && leisure == swimming_pool        # natural water used for swimming pool
61*    : W : natural == water && amenity == swimming_pool        # natural water used for swimming pool
62
63*    : W : /\d+/ == *                                          # numerical key
64
65# see #9071
66relation : W : type == route_master && route_master != *       # route_master relation without route_master=*
67
68# power related stuff (incomplete)
69*    : W : power == /line|minor_line|cable/ && voltage != *    # power line without voltage
70*    : W : substation == * && power != substation              # substation key without power=substation
71*    : W : transformer == * && power != *                      # transformer key without power
72*    : I : power == substation && substation != *              # missing substation=*
73*    : I : power == transformer && transformer != *            # missing transformer=*
74
75
76########################################
77# Rules derived from Taginfo statistics
78########################################
79
80# see ticket #5017
81# Taginfo query: select keypairs.key1, keypairs.key2, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key1='waterway' and keys.key=keypairs.key2 and (key1<>'highway' or keypairs.count_all>12000) and (key1<>'railway' or keypairs.count_all>3000) and (key1<>'waterway' or keypairs.count_all>800) and key2 not like '%:%' and from_fraction_all>0.97 and 1 union select keypairs.key2, keypairs.key1, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key2='waterway' and keys.key=keypairs.key1 and (key2<>'highway' or keypairs.count_all>12000) and (key2<>'railway' or keypairs.count_all>3000) and (key2<>'waterway' or keypairs.count_all>800) and key1 not like '%:%' and from_fraction_all>0.97 and 1 order by keypairs.count_all desc limit 1000;
82*    : W : incline              == * && highway != * && railway != *                   # incline without highway or railway
83way  : W : junction             == * && highway != *                                   # junction without highway
84*    : W : lanes                == * && highway != *                                   # lanes without highway
85*    : W : lcn                  == * && highway != *                                   # lcn without highway
86*    : W : lit                  == * && highway != * && railway != * && piste:type != * && amenity != /parking.*/ && public_transport != platform && advertising != billboard && leisure != pitch # lit on suspicious object
87*    : W : living_street        == * && highway != *                                   # living_street without highway
88*    : W : maintenance          == * && highway != *                                   # maintenance without highway
89*    : W : median               == * && highway != *                                   # median without highway
90*    : W : motorroad            == * && highway != *                                   # motorroad without highway
91*    : W : ntd_id               == * && highway != *                                   # ntd_id without highway
92*    : W : oneway               == * && highway != * && railway != *                   # oneway without highway or railway
93*    : W : sac_scale            == * && highway != *                                   # sac_scale without highway
94*    : W : segregated           == * && highway != * && railway != crossing            # segregated without highway
95*    : W : sidewalk             == * && highway != *                                   # sidewalk without highway
96*    : W : smoothness           == * && highway != *                                   # smoothness without highway
97*    : W : snowplowing          == * && highway != *                                   # snowplowing without highway
98*    : W : step_count           == * && highway != *                                   # step_count without highway
99*    : W : toll                 == * && highway != * && route != ferry                 # toll without highway
100*    : W : tracktype            == * && highway != *                                   # tracktype without highway
101*    : W : trail_visibility     == * && highway != *                                   # trail_visibility without highway
102*    : W : trolley_wire         == * && highway != *                                   # trolley_wire without highway
103*    : W : zip_left             == * && highway != *                                   # zip_left without highway
104*    : W : zip_right            == * && highway != *                                   # zip_right without highway
105*    : W : detail               == * && railway != *                                   # detail without railway
106*    : W : eddy_current_brake   == * && railway != *                                   # eddy_current_brake without railway
107*    : W : electrified          == * && railway != *                                   # electrified without railway
108*    : W : etcs                 == * && railway != *                                   # etcs without railway
109*    : W : gauge                == * && railway != *                                   # gauge without railway
110*    : W : grade_of_track       == * && railway != *                                   # grade_of_track without railway
111*    : W : kursbuchstrecke      == * && railway != *                                   # kursbuchstrecke without railway
112*    : W : lzb                  == * && railway != *                                   # lzb without railway
113*    : W : old_railway_operator == * && railway != *                                   # old_railway_operator without railway
114*    : W : operating_procedure  == * && railway != *                                   # operating_procedure without railway
115*    : W : pzb                  == * && railway != *                                   # pzb without railway
116*    : W : radio                == * && railway != *                                   # radio without railway
117*    : W : structure_gauge      == * && railway != *                                   # structure_gauge without railway
118*    : W : tilting_technology   == * && railway != *                                   # tilting_technologie without railway
119*    : W : track_class          == * && railway != *                                   # track_class without railway
120*    : W : tracks               == * && railway != *                                   # tracks without railway
121*    : W : traffic_mode         == * && railway != *                                   # traffic_mode without railway
122*    : W : usage                == * && railway != *                                   # usage without railway
123*    : W : workrules            == * && railway != *                                   # workrules without railway
124*    : W : stream               == * && waterway != *                                  # stream without waterway
125*    : W : intermittent         == * && waterway != *                                  # intermittent without waterway
126*    : W : boat                 == * && waterway != * && natural != water              # boat without waterway / natural=water
127*    : W : length_unit          == * && waterway != *                                  # length_unit without waterway
128*    : W : llid                 == * && waterway != *                                  # llid without waterway
129*    : W : canal                == * && waterway != *                                  # canal without waterway
130*    : W : have_riverbank       == * && waterway != *                                  # have_riverbank without waterway
131*    : W : tunnel               == * && highway != * && railway != * && waterway != * && public_transport != platform && man_made != pipeline  # tunnel without highway/railway/waterway/platform/pipeline
132*    : W : bridge               == * && highway != * && railway != * && waterway != * && piste:type != * && public_transport != platform && man_made != /bridge|pipeline/ && building != bridge  # bridge without highway/railway/waterway/platform/piste/pipeline
133*    : W : psv                  == * && highway != * && railway != * && waterway != * && amenity != /parking.*/  # psv without highway/railway/waterway/parking
134*    : W : width                == * && highway != * && railway != * && waterway != * && aeroway != * && cycleway != * && footway != * && barrier != * && man_made != * && entrance != *  # width without physical linear feature
135*    : W : maxspeed             == * && highway != * && railway != * && traffic_sign != /(.*;)?maxspeed(;.*)?/ && type != enforcement  # maxspeed without highway/railway/traffic_sign/enforcement
136*    : W : fence_type           == * && barrier != fence                               # fence_type without barrier=fence
137*    : W : border_type          == * && boundary != *                                  # border_type without boundary
138*    : W : recycling_type       == * && amenity != recycling                           # recycling_type without amenity=recycling
139*    : W : board_type           == * && information != board                           # board_type without information=board
140*    : W : shelter_type         == * && amenity != shelter                             # shelter_type without amenity=shelter
141*    : W : lamp_type            == * && highway != street_lamp                         # lamp_type without highway=street_lamp
142*    : W : map_type             == * && information != map                             # map_type without information=map
143*    : W : site_type            == * && historic != archaeological_site                # site_type without historic=archaeological_site
144*    : W : artwork_type         == * && tourism != artwork                             # artwork_type without tourism=artwork
145*    : W : castle_type          == * && historic != castle                             # castle_type without historic=castle
146*    : W : reservoir_type       == * && landuse != reservoir && water != reservoir     # reservoir_type without landuse/water=reservoir
147*    : W : bunker_type          == * && military != bunker                             # bunker_type without military=bunker
148*    : W : source:addr                  == * && /addr:.*/                != *          # source:addr without addr:*
149*    : W : source:date                  == * && source                   != *          # source:date without source
150*    : W : source:name                  == * && name                     != *          # source:name without name
151*    : W : source:maxspeed              == * && /maxspeed(:.*)?/         != *          # source:maxspeed without maxspeed
152*    : W : source:maxspeed:forward      == * && maxspeed:forward         != *          # source:maxspeed:forward without maxspeed:forward
153*    : W : source:maxspeed:backward     == * && maxspeed:backward        != *          # source:maxspeed:backward without maxspeed:backward
154*    : W : source:maxspeed:forward      == * && source:maxspeed:backward != *          # source:maxspeed:forward without source:maxspeed:backward
155*    : W : source:maxspeed:backward     == * && source:maxspeed:forward  != *          # source:maxspeed:backward without source:maxspeed:forward
156*    : W : source:building              == * && building                 != *          # source:building without building
157*    : W : source:ref                   == * && ref                      != *          # source:ref without ref
158*    : W : source:population            == * && population               != *          # source:population without population
159node : W : source:geometry              == *                                           # source:geometry on a node
160*    : W : /source:(addr:)?postcode/    == * && addr:postcode            != *          # source:[addr:]postcode without addr:postcode
161*    : W : source:postal_code           == * && postal_code              != *          # source:postal_code without postal_code
162*    : W : source:ele                   == * && ele                      != *          # source:ele without ele
163*    : W : source:ref:INSEE             == * && ref:INSEE                != *          # source:ref:INSEE without ref:INSEE
164*    : W : source:lit                   == * && lit                      != *          # source:lit without lit
165*    : W : source:hgv                   == * && hgv                      != *          # source:hgv without hgv
166node : W : source:outline               == *                                           # source:outline on a node
167*    : W : source:highway               == * && highway                  != *          # source:highway without highway
168*    : W : source:maxaxleload           == * && maxaxleload              != *          # source:maxaxleload without maxaxleload
169*    : W : source:surface               == * && surface                  != *          # source:surface without surface
170*    : W : source:bridge                == * && bridge                   != *          # source:bridge without bridge
171*    : W : source:old_name              == * && old_name                 != *          # source:old_name without old_name
172*    : W : source:bicycle               == * && bicycle                  != *          # source:bicycle without bicycle
173*    : W : source:designation           == * && designation              != *          # source:designation without designation
174*    : W : /source:(addr:)?housenumber/ == * && addr:housenumber         != *          # source:[addr:]housenumber without addr:housenumber
175*    : W : source:height                == * && height                   != *          # source:height without height
176*    : W : source:lanes                 == * && lanes                    != *          # source:lanes without lanes
177
178
179################################
180# Religion / Denomination tests
181################################
182
183* : I : religion == /christian|jewish|muslim/ && denomination != * # religion without denomination
184* : I : religion == christian && denomination == * && denomination != /anglican|apostolic|baptist|catholic|christian_community|christian_scientist|coptic_orthodox|czechoslovak_hussite|dutch_reformed|evangelical|foursquare|greek_catholic|greek_orthodox|jehovahs_witness|kabbalah|karaite|living_waters_church|lutheran|maronite|mennonite|methodist|mormon|new_apostolic|nondenominational|old_catholic|orthodox|pentecostal|presbyterian|protestant|quaker|roman_catholic|russian_orthodox|salvation_army|serbian_orthodox|seventh_day_adventist|united|united_reformed|uniting/  # unknown christian denomination
185* : I : religion == muslim && denomination == * && denomination != /alaouite|druze|ibadi|ismaili|nondenominational|shia|sunni/ # unknown muslim denomination
186* : I : religion == jewish && denomination == * && denomination != /alternative|ashkenazi|conservative|hasidic|humanistic|liberal|modern_orthodox|neo_orthodox|nondenominational|orthodox|progressive|reconstructionist|reform|renewal|samaritan|ultra_orthodox/ # unknown jewish denomination
187
188#####################################
189# validation for the wikipedia=* tag
190#####################################
191
192# see ticket #8383
193# If there is no language at all, this is broken. Also catches 'wikipedia' used as 'email', 'website', 'ele' [sic!] ...
194* : E : wikipedia == * && wikipedia != /[a-zA-Z_-]{2,12}:.*/ # no wikipedia-language given, use ''wikipedia''=''language:page title''
195# Valid languages are extracted from <http://de.wikipedia.org/w/api.php?action=sitematrix&format=xml>, which may change, so this is a warning only.
196* : W : wikipedia == /[a-zA-Z_-]{2,12}:.*/ && wikipedia != /(aa|ab|ace|af|ak|als|am|an|ang|ar|arc|arz|as|ast|av|ay|az|ba|bar|bat-smg|bcl|be|be-x-old|bg|bh|bi|bjn|bm|bn|bo|bpy|br|bs|bug|bxr|ca|cbk-zam|cdo|ce|ceb|ch|cho|chr|chy|ckb|co|cr|crh|cs|csb|cu|cv|cy|cz|da|de|diq|dk|dsb|dv|dz|ee|el|eml|en|eo|epo|es|et|eu|ext|fa|ff|fi|fiu-vro|fj|fo|fr|frp|frr|fur|fy|ga|gag|gan|gd|gl|glk|gn|got|gu|gv|ha|hak|haw|he|hi|hif|ho|hr|hsb|ht|hu|hy|hz|ia|id|ie|ig|ii|ik|ilo|io|is|it|iu|ja|jbo|jp|jv|ka|kaa|kab|kbd|kg|ki|kj|kk|kl|km|kn|ko|koi|kr|krc|ks|ksh|ku|kv|kw|ky|la|lad|lb|lbe|lez|lg|li|lij|lmo|ln|lo|lt|ltg|lv|map-bms|mdf|mg|mh|mhr|mi|minnan|mk|ml|mn|mo|mr|mrj|ms|mt|mus|mwl|my|myv|mzn|na|nah|nan|nap|nb|nds|nds-nl|ne|new|ng|nl|nn|no|nov|nrm|nso|nv|ny|oc|om|or|os|pa|pag|pam|pap|pcd|pdc|pfl|pi|pih|pl|pms|pnb|pnt|ps|pt|qu|rm|rmy|rn|ro|roa-rup|roa-tara|ru|rue|rw|sa|sah|sc|scn|sco|sd|se|sg|sh|si|simple|sk|sl|sm|sn|so|sq|sr|srn|ss|st|stq|su|sv|sw|szl|ta|te|tet|tg|th|ti|tk|tl|tn|to|tpi|tr|ts|tt|tum|tw|ty|udm|ug|uk|ur|uz|ve|vec|vep|vi|vls|vo|wa|war|wo|wuu|xal|xh|xmf|yi|yo|za|zea|zh|zh-cfr|zh-classical|zh-min-nan|zh-yue|zu):.*/  # unknown language prefix in wikipedia tag
Note: See TracBrowser for help on using the repository browser.