# JOSM TagChecker validator file # Format: # Each line specifies a certain error to be reported # : messagetype : # Lines starting with a # are considered as comments. # # Data type can be: # node - a node point # way - a way # relation - a relation # * - all data types # # Message type can be: # E - an error # W - a warning # I - an low priority informational warning # # Key and value are expressions describing certain keys and values of these keys. # Regular expressions are supported. In this case the expressions starts and # ends with a / sign. If an 'i' is appended, the regular expression is # case insensitive. For instance, /foo|bar/i # # The * sign indicates any string. # The texts BOOLEAN_TRUE and BOOLEAN_FALSE in the value part indicate a special # handling for boolean values (yes, true, 0, false, no, ...). # # Expression can be: # != - the key/value combination does not match # == - the key/value combination does match # # To have more complicated expressions, multiple elements can be grouped together # with an logical and (&&). # # The comment at the end of a rule is displayed in validator description # # Empty lines and space signs are ignored way : 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 node : W : oneway == * # oneway tag on a node node : W : bridge == BOOLEAN_TRUE # bridge tag on a node node : W : highway == /motorway*|trunk*|primary*|secondary*|tertiary*|unclassified|residential|service|living_street|pedestrian|track|path|footway/ # wrong highway tag on a node way : W : /highway|railway/ == crossing # wrong crossing tag on a way way : I : highway == unclassified && name != * # Unnamed unclassified highway way : I : highway == /motorway|trunk|primary|secondary|tertiary/ && ref != * # highway without a reference * : W : highway == road # temporary highway type * : W : / *name */i == * && name != * # misspelled key name # The following could replace unnamed way check. Still at the moment we keep it as it is #way : W : junction == roundabout && highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed junction #way : W : highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed way : W : highway == cycleway && bicycle == BOOLEAN_FALSE # cycleway with tag bicycle way : W : highway == footway && foot == BOOLEAN_FALSE # footway with tag foot #way : I : highway == cycleway && bicycle == * # cycleway with tag bicycle #way : I : highway == footway && foot == * # footway with tag foot way : W : highway == cycleway && cycleway == lane # separate cycleway as lane on a cycleway way : W : highway == * && barrier == * # barrier used on a way #way : I : waterway == * && layer != * # waterway without layer tag way : I : highway == footway && maxspeed == * # maxspeed used for footway way : I : highway == steps && maxspeed == * # maxspeed used for footway # see #5844, #6760 #way : W : oneway != BOOLEAN_FALSE && /.*:(backward|forward)/ == * # oneway combined with *:backward/forward * : W : layer == /\+.*/ # layer tag with + sign * : I : name == /.*Strasse.*/i # street name contains ss relation : E : type != * # relation without type node : I : amenity == /restaurant|cafe|fast_food/ && name != * # restaurant without name #way : I : highway != * && railway != * && waterway != * && name == * # unusual named way type #* : W : natural == water && waterway == * # unusual tag combination (natural=water & waterway) * : W : highway == * && waterway == * && waterway != dam # unusual tag combination (highway & waterway) * : W : highway == * && natural == * # unusual tag combination (highway & natural) * : W : landuse == * && building == * # unusual tag combination (landuse & building) * : W : highway == proposed && access == * # unnecessary access key * : W : highway == /motorway*|trunk*|primary*|secondary*|tertiary*|unclassified|residential|service|living_street/ && motor_vehicle == BOOLEAN_TRUE # unnecessary motor_vehicle=yes * : W : natural == water && leisure == swimming_pool # natural water used for swimming pool * : W : natural == water && amenity == swimming_pool # natural water used for swimming pool * : W : /\d+/ == * # numerical key # see #9071 relation : W : type == route_master && route_master != * # route_master relation without route_master=* # power related stuff (incomplete) * : W : power == /line|minor_line|cable/ && voltage != * # power line without voltage * : W : substation == * && power != substation # substation key without power=substation * : W : transformer == * && power != * # transformer key without power * : I : power == substation && substation != * # missing substation=* * : I : power == transformer && transformer != * # missing transformer=* ######################################## # Rules derived from Taginfo statistics ######################################## # see ticket #5017 # 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; * : W : incline == * && highway != * && railway != * # incline without highway or railway way : W : junction == * && highway != * # junction without highway * : W : lanes == * && highway != * # lanes without highway * : W : lcn == * && highway != * # lcn without highway * : W : lit == * && highway != * && railway != * && piste:type != * && amenity != /parking.*/ && public_transport != platform && advertising != billboard && leisure != pitch # lit on suspicious object * : W : living_street == * && highway != * # living_street without highway * : W : maintenance == * && highway != * # maintenance without highway * : W : median == * && highway != * # median without highway * : W : motorroad == * && highway != * # motorroad without highway * : W : ntd_id == * && highway != * # ntd_id without highway * : W : oneway == * && highway != * && railway != * # oneway without highway or railway * : W : sac_scale == * && highway != * # sac_scale without highway * : W : segregated == * && highway != * && railway != crossing # segregated without highway * : W : sidewalk == * && highway != * # sidewalk without highway * : W : smoothness == * && highway != * # smoothness without highway * : W : snowplowing == * && highway != * # snowplowing without highway * : W : step_count == * && highway != * # step_count without highway * : W : toll == * && highway != * && route != ferry # toll without highway * : W : tracktype == * && highway != * # tracktype without highway * : W : trail_visibility == * && highway != * # trail_visibility without highway * : W : trolley_wire == * && highway != * # trolley_wire without highway * : W : zip_left == * && highway != * # zip_left without highway * : W : zip_right == * && highway != * # zip_right without highway * : W : detail == * && railway != * # detail without railway * : W : eddy_current_brake == * && railway != * # eddy_current_brake without railway * : W : electrified == * && railway != * # electrified without railway * : W : etcs == * && railway != * # etcs without railway * : W : gauge == * && railway != * # gauge without railway * : W : grade_of_track == * && railway != * # grade_of_track without railway * : W : kursbuchstrecke == * && railway != * # kursbuchstrecke without railway * : W : lzb == * && railway != * # lzb without railway * : W : old_railway_operator == * && railway != * # old_railway_operator without railway * : W : operating_procedure == * && railway != * # operating_procedure without railway * : W : pzb == * && railway != * # pzb without railway * : W : radio == * && railway != * # radio without railway * : W : structure_gauge == * && railway != * # structure_gauge without railway * : W : tilting_technology == * && railway != * # tilting_technologie without railway * : W : track_class == * && railway != * # track_class without railway * : W : tracks == * && railway != * # tracks without railway * : W : traffic_mode == * && railway != * # traffic_mode without railway * : W : usage == * && railway != * # usage without railway * : W : workrules == * && railway != * # workrules without railway * : W : stream == * && waterway != * # stream without waterway * : W : intermittent == * && waterway != * # intermittent without waterway * : W : boat == * && waterway != * && natural != water # boat without waterway / natural=water * : W : length_unit == * && waterway != * # length_unit without waterway * : W : llid == * && waterway != * # llid without waterway * : W : canal == * && waterway != * # canal without waterway * : W : have_riverbank == * && waterway != * # have_riverbank without waterway * : W : tunnel == * && highway != * && railway != * && waterway != * && public_transport != platform && man_made != pipeline # tunnel without highway/railway/waterway/platform/pipeline * : W : bridge == * && highway != * && railway != * && waterway != * && piste:type != * && public_transport != platform && man_made != /bridge|pipeline/ && building != bridge # bridge without highway/railway/waterway/platform/piste/pipeline * : W : psv == * && highway != * && railway != * && waterway != * && amenity != /parking.*/ # psv without highway/railway/waterway/parking * : W : width == * && highway != * && railway != * && waterway != * && aeroway != * && cycleway != * && footway != * && barrier != * && man_made != * && entrance != * # width without physical linear feature * : W : maxspeed == * && highway != * && railway != * && traffic_sign != /(.*;)?maxspeed(;.*)?/ && type != enforcement # maxspeed without highway/railway/traffic_sign/enforcement * : W : fence_type == * && barrier != fence # fence_type without barrier=fence * : W : border_type == * && boundary != * # border_type without boundary * : W : recycling_type == * && amenity != recycling # recycling_type without amenity=recycling * : W : board_type == * && information != board # board_type without information=board * : W : shelter_type == * && amenity != shelter # shelter_type without amenity=shelter * : W : lamp_type == * && highway != street_lamp # lamp_type without highway=street_lamp * : W : map_type == * && information != map # map_type without information=map * : W : site_type == * && historic != archaeological_site # site_type without historic=archaeological_site * : W : artwork_type == * && tourism != artwork # artwork_type without tourism=artwork * : W : castle_type == * && historic != castle # castle_type without historic=castle * : W : reservoir_type == * && landuse != reservoir && water != reservoir # reservoir_type without landuse/water=reservoir * : W : bunker_type == * && military != bunker # bunker_type without military=bunker * : W : source:addr == * && /addr:*/ != * # source:addr without addr:* * : W : source:date == * && source != * # source:date without source * : W : source:name == * && name != * # source:name without name * : W : source:maxspeed == * && maxspeed != * # source:maxspeed without maxspeed * : W : source:building == * && building != * # source:building without building * : W : source:ref == * && ref != * # source:ref without ref * : W : source:population == * && population != * # source:population without population node : W : source:geometry == * # source:geometry on a node * : W : /source:*postcode/ == * && addr:postcode != * # source:[addr:]postcode without addr:postcode * : W : source:postal_code == * && addr:postcode != * # source:postal_code without addr:postcode * : W : source:ele == * && ele != * # source:ele without ele * : W : source:ref:INSEE == * && ref:INSEE != * # source:ref:INSEE without ref:INSEE * : W : source:lit == * && lit != * # source:lit without lit * : W : source:hgv == * && hgv != * # source:hgv without hgv node : W : source:outline == * # source:outline on a node * : W : source:highway == * && highway != * # source:highway without highway * : W : source:maxaxleload == * && maxaxleload != * # source:maxaxleload without maxaxleload * : W : source:surface == * && surface != * # source:surface without surface * : W : source:bridge == * && bridge != * # source:bridge without bridge * : W : source:old_name == * && old_name != * # source:old_name without old_name * : W : source:bicycle == * && bicycle != * # source:bicycle without bicycle * : W : source:designation == * && designation != * # source:designation without designation * : W : /source:*housenumber/ == * && addr:housenumber != * # source:[addr:]housenumber without addr:housenumber * : W : source:height == * && height != * # source:height without height * : W : source:lanes == * && lanes != * # source:lanes without lanes ################################ # Religion / Denomination tests ################################ * : I : religion == /christian|jewish|muslim/ && denomination != * # religion without denomination * : 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 * : I : religion == muslim && denomination == * && denomination != /alaouite|druze|ibadi|ismaili|nondenominational|shia|sunni/ # unknown muslim denomination * : 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 ##################################### # validation for the wikipedia=* tag ##################################### # see ticket #8383 # If there is no language at all, this is broken. Also catches 'wikipedia' used as 'email', 'website', 'ele' [sic!] ... * : E : wikipedia == * && wikipedia != /[a-zA-Z_-]{2,12}:.*/ # no wikipedia-language given, use ''wikipedia''=''language:page title'' # Valid languages are extracted from , which may change, so this is a warning only. * : 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 # measurement values and units warnings (ticket #8687) way : W : layer == * && layer != /^0$|^-?[1-5]$/ # layer should be between -5 and 5 * : 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 * : 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 * : 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 way : 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 * : 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 way : 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 way : W : voltage == * && voltage == /(.*[A-Za-z].*)|.*,.*|.*( ).*/ # voltage should be in volts with no units/delimiter/spaces # 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 way : W : frequency == * && frequency != /^(0|[1-9][0-9]*(\.[0-9]+)?)( (kHz|MHz|GHz|THz))?$/ # unusual frequency specification way : 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 # the numbers for percentage and degrees include could probably be bracketed a bit more precisely way : W : incline == * && incline != /^(up|down|-?([0-9]+?(\.[1-9]%)?|100)[%°]?)$/ # unusual incline; use percentages/degrees or up/down