source: josm/trunk/data/tagchecker.cfg@ 6481

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

see #9400 - tagchecker: warnings for source:* tags without their main tag

  • Property svn:eol-style set to native
File size: 23.0 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
39way : W : highway == * && name == /.* (Ave|Blvd|Br|Brg|Cct|Cir|Cl|Cr|Crct|Cres|Crt|Ct|Dr|Drv|Esp|Espl|Hwy|Ln|Mw|Mwy|Pl|Rd|Qy|Qys|Sq|St|Str|Ter|Tce|Tr|Wy)\.?$/i # abbreviated street name
40
41node : W : oneway == * # oneway tag on a node
42node : W : bridge == BOOLEAN_TRUE # bridge tag on a node
43node : W : highway == /motorway*|trunk*|primary*|secondary*|tertiary*|unclassified|residential|service|living_street|pedestrian|track|path|footway/ # wrong highway tag on a node
44way : W : /highway|railway/ == crossing # wrong crossing tag on a way
45way : I : highway == unclassified && name != * # Unnamed unclassified highway
46way : I : highway == /motorway|trunk|primary|secondary|tertiary/ && ref != * # highway without a reference
47* : W : highway == road # temporary highway type
48* : W : / *name */i == * && name != * # misspelled key name
49
50# The following could replace unnamed way check. Still at the moment we keep it as it is
51#way : W : junction == roundabout && highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed junction
52#way : W : highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed
53
54way : W : highway == cycleway && bicycle == BOOLEAN_FALSE # cycleway with tag bicycle
55way : W : highway == footway && foot == BOOLEAN_FALSE # footway with tag foot
56#way : I : highway == cycleway && bicycle == * # cycleway with tag bicycle
57#way : I : highway == footway && foot == * # footway with tag foot
58way : W : highway == cycleway && cycleway == lane # separate cycleway as lane on a cycleway
59way : W : highway == * && barrier == * # barrier used on a way
60
61#way : I : waterway == * && layer != * # waterway without layer tag
62way : I : highway == footway && maxspeed == * # maxspeed used for footway
63way : I : highway == steps && maxspeed == * # maxspeed used for footway
64
65# see #5844, #6760
66#way : W : oneway != BOOLEAN_FALSE && /.*:(backward|forward)/ == * # oneway combined with *:backward/forward
67
68* : W : layer == /\+.*/ # layer tag with + sign
69
70* : I : name == /.*Strasse.*/i # street name contains ss
71
72relation : E : type != * # relation without type
73
74node : I : amenity == /restaurant|cafe|fast_food/ && name != * # restaurant without name
75#way : I : highway != * && railway != * && waterway != * && name == * # unusual named way type
76#* : W : natural == water && waterway == * # unusual tag combination (natural=water & waterway)
77* : W : highway == * && waterway == * && waterway != dam # unusual tag combination (highway & waterway)
78* : W : highway == * && natural == * # unusual tag combination (highway & natural)
79* : W : landuse == * && building == * # unusual tag combination (landuse & building)
80
81* : W : highway == proposed && access == * # unnecessary access key
82* : W : highway == /motorway*|trunk*|primary*|secondary*|tertiary*|unclassified|residential|service|living_street/ && motor_vehicle == BOOLEAN_TRUE # unnecessary motor_vehicle=yes
83
84* : W : natural == water && leisure == swimming_pool # natural water used for swimming pool
85* : W : natural == water && amenity == swimming_pool # natural water used for swimming pool
86
87* : W : /\d+/ == * # numerical key
88
89# see #9071
90relation : W : type == route_master && route_master != * # route_master relation without route_master=*
91
92# power related stuff (incomplete)
93* : W : power == /line|minor_line|cable/ && voltage != * # power line without voltage
94* : W : substation == * && power != substation # substation key without power=substation
95* : W : transformer == * && power != * # transformer key without power
96* : I : power == substation && substation != * # missing substation=*
97* : I : power == transformer && transformer != * # missing transformer=*
98
99
100########################################
101# Rules derived from Taginfo statistics
102########################################
103
104# see ticket #5017
105# 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;
106* : W : incline == * && highway != * && railway != * # incline without highway or railway
107way : W : junction == * && highway != * # junction without highway
108* : W : lanes == * && highway != * # lanes without highway
109* : W : lcn == * && highway != * # lcn without highway
110* : W : lit == * && highway != * && railway != * && piste:type != * && amenity != /parking.*/ && public_transport != platform # lit without highway/railway/piste/parking/platform
111* : W : living_street == * && highway != * # living_street without highway
112* : W : maintenance == * && highway != * # maintenance without highway
113* : W : median == * && highway != * # median without highway
114* : W : motorroad == * && highway != * # motorroad without highway
115* : W : ntd_id == * && highway != * # ntd_id without highway
116* : W : oneway == * && highway != * && railway != * # oneway without highway or railway
117* : W : sac_scale == * && highway != * # sac_scale without highway
118* : W : segregated == * && highway != * # segregated without highway
119* : W : sidewalk == * && highway != * # sidewalk without highway
120* : W : smoothness == * && highway != * # smoothness without highway
121* : W : snowplowing == * && highway != * # snowplowing without highway
122* : W : step_count == * && highway != * # step_count without highway
123* : W : toll == * && highway != * && route != ferry # toll without highway
124* : W : tracktype == * && highway != * # tracktype without highway
125* : W : trail_visibility == * && highway != * # trail_visibility without highway
126* : W : trolley_wire == * && highway != * # trolley_wire without highway
127* : W : zip_left == * && highway != * # zip_left without highway
128* : W : zip_right == * && highway != * # zip_right without highway
129* : W : detail == * && railway != * # detail without railway
130* : W : eddy_current_brake == * && railway != * # eddy_current_brake without railway
131* : W : electrified == * && railway != * # electrified without railway
132* : W : etcs == * && railway != * # etcs without railway
133* : W : gauge == * && railway != * # gauge without railway
134* : W : grade_of_track == * && railway != * # grade_of_track without railway
135* : W : kursbuchstrecke == * && railway != * # kursbuchstrecke without railway
136* : W : lzb == * && railway != * # lzb without railway
137* : W : old_railway_operator == * && railway != * # old_railway_operator without railway
138* : W : operating_procedure == * && railway != * # operating_procedure without railway
139* : W : pzb == * && railway != * # pzb without railway
140* : W : radio == * && railway != * # radio without railway
141* : W : structure_gauge == * && railway != * # structure_gauge without railway
142* : W : tilting_technology == * && railway != * # tilting_technologie without railway
143* : W : track_class == * && railway != * # track_class without railway
144* : W : tracks == * && railway != * # tracks without railway
145* : W : traffic_mode == * && railway != * # traffic_mode without railway
146* : W : usage == * && railway != * # usage without railway
147* : W : workrules == * && railway != * # workrules without railway
148* : W : stream == * && waterway != * # stream without waterway
149* : W : intermittent == * && waterway != * # intermittent without waterway
150* : W : boat == * && waterway != * && natural != water # boat without waterway / natural=water
151* : W : length_unit == * && waterway != * # length_unit without waterway
152* : W : llid == * && waterway != * # llid without waterway
153* : W : canal == * && waterway != * # canal without waterway
154* : W : have_riverbank == * && waterway != * # have_riverbank without waterway
155* : W : tunnel == * && highway != * && railway != * && waterway != * && public_transport != platform && man_made != pipeline # tunnel without highway/railway/waterway/platform/pipeline
156* : W : bridge == * && highway != * && railway != * && waterway != * && piste:type != * && public_transport != platform && man_made != /bridge|pipeline/ && building != bridge # bridge without highway/railway/waterway/platform/piste/pipeline
157* : W : psv == * && highway != * && railway != * && waterway != * && amenity != /parking.*/ # psv without highway/railway/waterway/parking
158* : W : width == * && highway != * && railway != * && waterway != * && aeroway != * && cycleway != * && footway != * && barrier != * && man_made != * && entrance != * # width without physical linear feature
159* : W : maxspeed == * && highway != * && railway != * && traffic_sign != /(.*;)?maxspeed(;.*)?/ && type != enforcement # maxspeed without highway/railway/traffic_sign/enforcement
160* : W : fence_type == * && barrier != fence # fence_type without barrier=fence
161* : W : border_type == * && boundary != * # border_type without boundary
162* : W : recycling_type == * && amenity != recycling # recycling_type without amenity=recycling
163* : W : board_type == * && information != board # board_type without information=board
164* : W : shelter_type == * && amenity != shelter # shelter_type without amenity=shelter
165* : W : lamp_type == * && highway != street_lamp # lamp_type without highway=street_lamp
166* : W : map_type == * && information != map # map_type without information=map
167* : W : site_type == * && historic != archaeological_site # site_type without historic=archaeological_site
168* : W : artwork_type == * && tourism != artwork # artwork_type without tourism=artwork
169* : W : castle_type == * && historic != castle # castle_type without historic=castle
170* : W : reservoir_type == * && landuse != reservoir && water != reservoir # reservoir_type without landuse/water=reservoir
171* : W : bunker_type == * && military != bunker # bunker_type without military=bunker
172* : W : source:addr == * && /addr:*/ != * # source:addr without addr:*
173* : W : source:date == * && source != * # source:date without source
174* : W : source:name == * && name != * # source:name without name
175* : W : source:maxspeed == * && maxspeed != * # source:maxspeed without maxspeed
176* : W : source:building == * && building != * # source:building without building
177* : W : source:ref == * && ref != * # source:ref without ref
178* : W : source:population == * && population != * # source:population without population
179node : W : source:geometry == * # source:geometry on a node
180* : W : /source:*postcode/ == * && addr:postcode != * # source:[addr:]postcode without addr:postcode
181* : W : source:postal_code == * && addr:postcode != * # source:postal_code without addr:postcode
182* : W : source:ele == * && ele != * # source:ele without ele
183* : W : source:ref:INSEE == * && ref:INSEE != * # source:ref:INSEE without ref:INSEE
184* : W : source:lit == * && lit != * # source:lit without lit
185* : W : source:hgv == * && hgv != * # source:hgv without hgv
186node : W : source:outline == * # source:outline on a node
187* : W : source:highway == * && highway != * # source:highway without highway
188* : W : source:maxaxleload == * && maxaxleload != * # source:maxaxleload without maxaxleload
189* : W : source:surface == * && surface != * # source:surface without surface
190* : W : source:bridge == * && bridge != * # source:bridge without bridge
191* : W : source:old_name == * && old_name != * # source:old_name without old_name
192* : W : source:bicycle == * && bicycle != * # source:bicycle without bicycle
193* : W : source:designation == * && designation != * # source:designation without designation
194* : W : /source:*housenumber/ == * && addr:housenumber != * # source:[addr:]housenumber without addr:housenumber
195* : W : source:height == * && height != * # source:height without height
196* : W : source:lanes == * && lanes != * # source:lanes without lanes
197
198
199################################
200# Religion / Denomination tests
201################################
202
203* : I : religion == /christian|jewish|muslim/ && denomination != * # religion without denomination
204* : 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
205* : I : religion == muslim && denomination == * && denomination != /alaouite|druze|ibadi|ismaili|nondenominational|shia|sunni/ # unknown muslim denomination
206* : 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
207
208#####################################
209# validation for the wikipedia=* tag
210#####################################
211
212# see ticket #8383
213# If there is no language at all, this is broken. Also catches 'wikipedia' used as 'email', 'website', 'ele' [sic!] ...
214* : E : wikipedia == * && wikipedia != /[a-zA-Z_-]{2,12}:.*/ # no wikipedia-language given, use ''wikipedia''=''language:page title''
215# 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.
216* : 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
217
218# measurement values and units warnings (ticket #8687)
219way : W : layer == * && layer != /^0$|^-?[1-5]$/ # layer should be between -5 and 5
220* : W : level == * && level != /^((([0-9]|-[1-9])|[1-9][0-9]*)(\.5)?)(;(([0-9]|-[1-9])|[1-9][0-9]*)(\.5)?)*$|^-0\.5$/ # level should be numbers with optional .5 increments
221* : W : height == * && height != /^(([0-9]+\.?[0-9]*( m)?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/ # height: meters is default; period is separator; if units, put space then unit
222
223* : W : maxheight == * && maxheight != /^(([1-9][0-9]*(\.[0-9]+)?( m)?)|([0-9]+\'([0-9]|10|11)(\.[0-9]*)?\"))$/ # maxheight: meters is default; period is separator; if units, put space then unit
224way : W : width == * && width != /^(([0-9]+\.?[0-9]*( [a-z]+)?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/ # width: meters is default; period is separator; if units, put space then unit
225* : W : maxwidth == * && maxwidth != /^(([0-9]+\.?[0-9]*( m)?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/ # maxwidth: meters is default; period is separator; if units, put space then unit
226way : W : maxspeed == * && maxspeed != /^(signals|none|unposted|unknown|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/ # unusual maxspeed format
227way : W : voltage == * && voltage == /(.*[A-Za-z].*)|.*,.*|.*( ).*/ # voltage should be in volts with no units/delimiter/spaces
228# some users are using frequency for other purposes (not electromagnetic) with the values 'perennial' and 'intermittent'; the vast majority are 0, 16.7, 50 and 60
229way : W : frequency == * && frequency != /^(0|[1-9][0-9]*(\.[0-9]+)?)( (kHz|MHz|GHz|THz))?$/ # unusual frequency specification
230way : W : gauge == * && gauge != /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*|broad|standard|narrow)$/ # unusual train track gauge; use mm with no separator
231# the numbers for percentage and degrees include could probably be bracketed a bit more precisely
232way : W : incline == * && incline != /^(up|down|-?([0-9]+?(\.[1-9]%)?|100)[%°]?)$/ # unusual incline; use percentages/degrees or up/down
Note: See TracBrowser for help on using the repository browser.