Last active
October 11, 2017 12:10
-
-
Save maxerickson/0ced75f967fda188f89875538bb7b19a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* JOSM Validator rules for flagging potential issues with US highways */ | |
way[highway=unclassified][!name][!ref]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Unnamed highway=unclassified"); | |
} | |
way!:closed[highway=~/ry/]>[index=1] node!:connection:in-downloaded-area, | |
way!:closed[highway=~/ry/]>[index=-1] node!:connection:in-downloaded-area{ | |
group: tr("US Highways - Geometry"); | |
throwWarning: tr("Unconnected end node."); | |
} | |
way[highway]>[index=1] node!:connection:in-downloaded-area[highway=mini_roundabout], | |
way[highway]>[index=-1] node!:connection:in-downloaded-area[highway=mini_roundabout]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Mini roundabout that is not a junction."); | |
} | |
node[highway=turning_circle][traffic_calming=island], | |
node[highway=turning_loop][traffic_calming=island]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Traffic island used in place of turning_loop."); | |
fixAdd: "highway=turning_loop"; | |
fixRemove: "traffic_calming"; | |
} | |
way[highway][/^name_?/=~/(?i)(^|\s|;)(Aveue|Boullevard)[.]?(\s|;|$)/]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check spelling of {0}.", "{1.key}"); | |
} | |
way[highway][/^name_?/=~/(?i)(^|\s)(Trails)[.]?(\s|$)/]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check use of Trails in {0}.", "{1.key}"); | |
} | |
way[highway][/^name_?/=~/(?i)(^|\s)(Centre)[.]?(\s|$)/]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check that Centre is correct spelling in {0}.", "{1.key}"); | |
} | |
way[highway][/^name_?/=~/Alley/][service!=alley]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Check if way is an alley."); | |
} | |
way[highway][ref=~/(?i)(?:BL|BR|BUS |CONN |OLD|M-|&|\/)/]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Check oddly formatted ref."); | |
} | |
way[highway=residential][/^name_?/=~/(?i)(^|\s)(Airport|Business|Commerce|Commercial|Corporate|Corporation|Enterprise|Executive|Factory|Financial|Government|Headquarters|Hospital|Industrial|Industry|Logistic|Lumber|Manufactur|Manufacturers|Manufacturing|Market|Medical|Merchant|Office|Operations|Plastics|Precision|Professional|Progress|Quality|Research|Retail|Tech|Technical|Technology|Trade|Utility|Venture|Warehouse)[.]?(\s|$)/]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Check residential classification of {0}.", "{1.key}"); | |
} | |
way[highway][/^is_in/]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("is_in tag on highway"); | |
} | |
way[highway][/(?i)fixme/=~/dual carriageway/][oneway=yes]{ | |
group: tr("US Highways - Tagging"); | |
throwWarning: tr("Check obsolete fixme tag"); | |
} | |
way[highway][/^name_?/=~/(?i)(^| )(Mc|Mac) /]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check space in word beginning with Mc."); | |
} | |
way[highway][/^name_?/=~/ /]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Repeated space in name."); | |
} | |
way[highway][/^name_?/=~/[A-Z]{2,}/]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check run of uppercase letters."); | |
} | |
way[highway][/^name_?/=~/(^|\s)(?!(a|and|at|by|de|del|for|in|of|la|on|the|to)(\s|$))[a-z]/]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check capitalization of name."); | |
} | |
/* TIGER focused rules */ | |
way[highway][/^name_?/=~/(?i)(?:^|\s)(N|S|W|E|W|NW|NE|SW|SE)[.]?(?:\s|$)/]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Abbreviated cardinal direction?."); | |
} | |
way[highway][/^name_?/=~/(?i)(North|South) (W|E|West|East) /]{ | |
group: tr("US Highways - Name formatting"); | |
throwWarning: tr("Check split directional prefix."); | |
} | |
way[highway][/^name_?/=~/(?i)(^|\s|;)(Abnd|Aly|Anx|Appts|Ave|Bch|Blvd|Br|Brg|Brv|Byp|CC|Cct|Cem|Ch|Cir|Ck|Cl|Clfs|Cnty|Co|Cpl|Cr|Crct|Cres|Crk|Crst|Crt|Ct|Cty|Cv|Dr|Drv|Esp|Espl|Est|Expwy|Ext|Ff|Fl|Fs|Ft|GR|Gr|Grd|Grn|Hgts|Hgwy|Hts|Hw|Hwy|Ind|Industrl|Is|Knl|Lgn|Lk|Ln|Mem|Mh|Mhp|Ml|Mt|Mtn|Mw|Mwy|Nat|Ovps|Pk|Pkw|Pkwy|Pky|Pl|Pr|Psge|Pvt|Qy|Qys|RR|Rd|Rdg|Regnl|Rev|Rt|Rte|Sch|Scho|Sq|Srv|St|Ste|Sthwy|Sthy|Str|Stte|Svc|Tce|Ter|Terr|Tk|Tr|Trfy|Trl|Trlr|Twp|U S F S|Usfs|Vlg|Wy|Xing)[.]?(\s|;|$)/]{ | |
group: tr("US Highways - Abbreviated name"); | |
throwWarning: tr("Abbreviated {0}.", "{1.key}"); | |
} | |
way[highway][/^name_?/=~/(?i)(^|\s)(ALLEE|ALLY|ALY|ANEX|ANNX|ANX|ARC|AV|AVE|AVEN|AVENU|AVN|AVNUE|BAYOO|BCH|BG|BGS|BLF|BLFS|BLUF|BLVD|BND|BOT|BOTTM|BOUL|BOULV|BR|BRDGE|BRG|BRK|BRKS|BRNCH|BTM|BYP|BYPA|BYPAS|BYPS|BYU|CANYN|CAUSWA|CEN|CENT|CENTR|CIR|CIRC|CIRCL|CIRS|CLB|CLF|CLFS|CMN|CMNS|CMP|CNTER|CNTR|CNYN|COR|CORS|CP|CPE|CRCL|CRCLE|CRES|CRK|CRSE|CRSENT|CRSNT|CRSSNG|CRST|CSWY|CT|CTR|CTRS|CTS|CURV|CV|CVS|CYN|DIV|DL|DM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RL|TRLR|TRLRS|TRLS|TRNPK|TRWY|TUNEL|TUNL|TUNLS|TUNNELS|TUNNL|TURNPK|UN|UNS|UPAS|VALLY|VDCT|VIA|VIADCT|VILL|VILLAG|VILLG|VIS|VIST|VL|VLG|VLGS|VLLY|VLY|VLYS|VST|VSTA|VW|VWS|WL |WLS|WY|XING|XRD|XRDS)[.]?(\s|$)/]{ | |
group: tr("US Highways - Abbreviated name"); | |
throwWarning: tr("Abbreviated postal {0}.", "{1.key}"); | |
} | |
/* hint https://josm.openstreetmap.de/ticket/11985 */ | |
*[name = *name_1], | |
*[name = *name_2], | |
*[name = *name_3]{ | |
group: tr("US Highways - TIGER problems"); | |
throwWarning: tr("Extra name matches name."); | |
} | |
way[name_1][!name] | |
way[name_2][!name] | |
way[name_3][!name] | |
way[name_4][!name]{ | |
group: tr("US Highways - TIGER problems"); | |
throwWarning: tr("{0} without name.", "{0.key}"); | |
} | |
way[highway=service]["tiger:cfcc"=A74][name]{ | |
group: tr("US Highways - TIGER problems"); | |
throwWarning: "Named Tiger Service road"; | |
} | |
way[highway=service][access=private][eval(waylength()>999)]{ | |
group: tr("US Highways - TIGER problems"); | |
throwWarning: tr("Check long private service drive."); | |
} | |
way["tiger:cfcc"="A42"][tunnel=yes]{ | |
group: tr("US Highways - TIGER problems"); | |
throwWarning: tr("Tiger tunnel."); | |
} | |
node["tiger:county"], | |
node[source=~/(?i)tiger_import/]{ | |
group: tr("US Highways - TIGER problems"); | |
throwWarning: tr("Leftover tiger tags on node."); | |
fixRemove: "tiger:county"; | |
fixRemove: "source"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment