/**********************************************/ /* Don't edit this file. It is auto generated */ /**********************************************/ meta { title: "MapThisWay"; version: "0.136"; description: "Controlli \"mapcss\" pensati per chi mappa in Italia"; author: "francians"; watch-modified: true; } /******************************/ /* addresses.validator.mapcss */ /******************************/ /* mtw addressonbuilding */ way[inside("IT")][building][tag_regex("^addr:*")] { throwWarning: tr("{0} together with {1}", "{1.key}", "addr:*"); group: "MapThisWay (Addresses)"; } /* mtw namenotcapitalized */ *[inside("IT")][addr:street =~ /^[a-z]/] { throwWarning: tr("unusual value of {0}", "{1.key}: iniziale non in maiuscolo"); group: "MapThisWay (Addresses)"; } /* mtw numerocivicoerrato */ *[inside("IT")][addr:housenumber][addr:housenumber !~ /^((0(?!0)|[1-9][0-9]*)([a-z]?|(\/[1-9][0-9]*[a-z]?)|bis|((qua)?ter))(\b rosso\b)?)([;,](0(?!0)|[1-9][0-9]*)([a-z]?|(\/[1-9][0-9]*[a-z]?)|bis|((qua)?ter))(\b rosso\b)?)*$/] { throwWarning: tr("unusual value of {0}", "{1.key}: https://wiki.openstreetmap.org/wiki/IT:Addresses#Come_inserire_gli_indirizzi_2"); group: "MapThisWay (Addresses)"; assertMatch: "node \"addr:housenumber\"=\"00\""; assertMatch: "node \"addr:housenumber\"=\"01\""; assertMatch: "node \"addr:housenumber\"=\"a\""; assertMatch: "node \"addr:housenumber\"=\"1A\""; assertMatch: "node \"addr:housenumber\"=\"1 a\""; assertMatch: "node \"addr:housenumber\"=\"1/BIS\""; assertMatch: "node \"addr:housenumber\"=\"0/0\""; assertMatch: "node \"addr:housenumber\"=\"1 nero\""; assertNoMatch: "node \"addr:housenumber\"=\"1\""; assertNoMatch: "node \"addr:housenumber\"=\"1a\""; assertNoMatch: "node \"addr:housenumber\"=\"1bis\""; assertNoMatch: "node \"addr:housenumber\"=\"1ter\""; assertNoMatch: "node \"addr:housenumber\"=\"1quater\""; assertNoMatch: "node \"addr:housenumber\"=\"1/1\""; assertNoMatch: "node \"addr:housenumber\"=\"95/1a\""; assertNoMatch: "node \"addr:housenumber\"=\"1 rosso\""; assertNoMatch: "node \"addr:housenumber\"=\"0\""; assertNoMatch: "node \"addr:housenumber\"=\"0a\""; assertMatch: "node \"addr:housenumber\"=\"00,1\""; assertMatch: "node \"addr:housenumber\"=\"0,01\""; assertMatch: "node \"addr:housenumber\"=\"00;1\""; assertMatch: "node \"addr:housenumber\"=\"0;01\""; assertNoMatch: "node \"addr:housenumber\"=\"1a,1b,1c\""; assertNoMatch: "node \"addr:housenumber\"=\"1a;1b;1c\""; assertMatch: "node \"addr:housenumber\"=\"1-3\""; } /******************************/ /* amenities.validator.mapcss */ /******************************/ /* mtw refvatin */ *[inside("IT")][ref:vatin][ref:vatin !~ /^IT[0-9]{11}$/] { throwError: tr("wrong value: {0}", "{1.tag}: deve essere IT seguito da 11 cifre"); group: "MapThisWay (Amenities)"; } /* mtw namenotcapitalized2 */ *[inside("IT")][name =~ /^[a-z]/] { throwWarning: tr("unusual value of {0}", "{1.key}: iniziale non in maiuscolo"); group: "MapThisWay (Amenities)"; } /*********************************/ /* combinations.validator.mapcss */ /*********************************/ /* mtw missingdispensing */ *[inside("IT")][amenity=pharmacy][!dispensing] { throwWarning: tr("{0} without {1}", "{1.tag}", "{2.key}"); group: "MapThisWay (Combinations)"; } /* mtw restaurantkebab */ *[inside("IT")][amenity=restaurant][cuisine ~= "kebab"] { throwWarning: tr("{0} together with {1}", "{1.tag}", "{2.key}=kebab"); suggestAlternative: "amenity=fast_food"; group: "MapThisWay (Combinations)"; fixRemove: "{1.key}"; fixAdd: "{1.key}=fast_food"; } /* mtw oldauthorization */ *[inside("IT")][shop=tobacco][ref], *[inside("IT")][shop=tobacco][authorization] { throwWarning: tr("{0} is deprecated", "{2.key}"); group: "MapThisWay (Combinations)"; suggestAlternative: "ref:tobacco"; fixChangeKey: "{2.key} => ref:tobacco"; } /******************************/ /* highways.validator.mapcss */ /******************************/ /* mtw roundaboutwithname */ way[inside("IT")][junction=roundabout][name][name !~ /^(?i)(rotatoria|rotonda)[ ]/] { throwWarning: tr("{0} together with {1}", "{1.tag}", "{2.key}"); group: "MapThisWay (Highways)"; } /* mtw invaliddug - suggested by canfe */ way[inside("IT")][highway][name][highway !~ /cycleway|path|via_ferrata/][name !~ /^(?i)(arco|autostrada|belvedere|calata|calle|cavalcavia|circonvallazione|corso|corte|cortile|discesa|galleria|gradinata|larghetto|largo|litoranea|lungargine|lungo[a-z]+|molo|parcheggio|passaggio|passeggiata|percorso ciclabile|percorso ciclopedonale|percorso pedonale|piazza|piazzale|piazzetta|pista ciclabile|ponte|raccordo|rampa|ronco|rotatoria|rotonda|salita|scalinata|scesa|sentiero|slargo|sottopasso|sovrappasso|spiazzo|strada|strada antica|strada comunale|strada consortile|strada nuova|strada panoramica|strada poderale|strada privata|strada provinciale|strada regionale|strada statale|strada vecchia|strada vicinale|stradella|stradello|stradone|tangenziale|traversa|traversa privata|via|via antica|via comunale|via nazionale|via nuova|via panoramica|via privata|via provinciale|via vecchia|viale|vialetto|vico|vico chiuso|vico cieco|vico privato|vicoletto|vicolo|vicolo chiuso|vicolo cieco|vicolo privato|viottolo)[ ]/] { throwWarning: tr("unusual value of {0}", "{2.key}: non trovato in elenco Registro delle Denominazioni Urbanistiche Generiche (DUG)"); group: "MapThisWay (Highways)"; } /* mtw nolivingstreet */ way[inside("IT")][highway=living_street] { throwWarning: tr("Unspecific tag {0}", "{1.tag}"); group: "MapThisWay (Highways)"; } /* mtw unusualmaxspeed */ way[inside("IT")][highway][maxspeed][maxspeed !~ /^(5|10|15|20|30|40|50|60|70|80|90|100|110|120|130)$/] { throwWarning: tr("unusual value of {0}", "{2.tag}"); group: "MapThisWay (Highways)"; set unusual_maxspeed; } /* mtw maxspeedhigh */ way[inside("IT")][highway=primary][maxspeed][maxspeed > 110]!.unusual_maxspeed, way[inside("IT")][highway=secondary][maxspeed][maxspeed > 90]!.unusual_maxspeed, way[inside("IT")][highway=tertiary][maxspeed][maxspeed > 90]!.unusual_maxspeed, way[inside("IT")][highway=residential][maxspeed][maxspeed > 50]!.unusual_maxspeed { throwWarning: tr("{0} together with {1}", "{1.tag}", "{2.tag}"); group: "MapThisWay (Highways)"; } /* mtw refwithspace - suggested by Andrea Musuruane */ way[inside("IT")][highway][ref][ref =~ /(\s+)|[;]/] { throwWarning: tr("unusual value of {0}", "{2.key}: https://wiki.openstreetmap.org/wiki/IT:Italian_Roads_Tagging#ref"); group: "MapThisWay (Highways)"; } /* mtw crossingzebranouk */ *[inside("IT")][highway][crossing=zebra] { throwError: tr("wrong value: {0}", "{2.tag}"); suggestAlternative: "crossing=uncontrolled + crossing:markings=zebra"; group: "MapThisWay (Highways)"; fixRemove: "crossing"; fixAdd: "crossing=uncontrolled"; fixAdd: "crossing:markings=zebra"; } /* mtw crossingmarked */ *[inside("IT")][highway][crossing=marked] { throwWarning: tr("{0} together with {1}", "{1.key}", "{2.tag}"); suggestAlternative: "crossing=uncontrolled + crossing:markings=*"; group: "MapThisWay (Highways)"; fixRemove: "crossing"; fixAdd: "crossing=uncontrolled"; fixAdd: "crossing:markings=yes"; } /* mtw crossingrefzebra */ *[inside("IT")][highway][crossing_ref=zebra] { throwWarning: tr("Unspecific tag {0}", "{2.tag}"); suggestAlternative: "crossing:markings=zebra"; group: "MapThisWay (Highways)"; fixRemove: "crossing_ref"; fixAdd: "crossing:markings=zebra"; } /* mtw crossingref */ *[inside("IT")][highway][crossing_ref][crossing_ref!=zebra] { throwWarning: tr("Unspecific tag {0}", "{2.tag}"); suggestAlternative: "crossing:markings=*"; group: "MapThisWay (Highways)"; } way[inside("IT")][highway=cycleway][foot=designated], way[inside("IT")][highway=path][foot=designated][bicycle=designated] { set pista_ciclopedonale; } /* mtw segregatedwronghighway */ way[inside("IT")][highway][segregated]!.pista_ciclopedonale { throwWarning: tr("{0} together with {1}", "{1.key}", "{2.tag}"); group: "MapThisWay (Highways)"; } /* mtw pathwithfootyes */ way[inside("IT")][highway][foot=no][motorroad=yes], way[inside("IT")][highway][foot=yes][motorroad!=yes][highway!=cycleway], way[inside("IT")][highway=cycleway][foot=no], way[inside("IT")][highway=cycleway][bicycle=designated], way[inside("IT")][highway][bicycle=no][motorroad=yes][highway!=pedestrian], way[inside("IT")][highway][bicycle=yes][motorroad!=yes][highway!=footway][highway!=pedestrian], way[inside("IT")][highway=footway][bicycle=no], way[inside("IT")][highway=footway][foot=designated] { throwWarning: tr("{0} is unnecessary", "{2.tag}"); group: "MapThisWay (Highways)"; fixRemove: "{2.key}"; } /* mtw pedestrianwithoutbicycle */ way[inside("IT")][highway=pedestrian][!bicycle] { throwWarning: tr("{0} without {1}", "{1.tag}", "{2.key}"); group: "MapThisWay (Highways)"; } /* mtw onelanenooneway - Suggested by Volker */ way[highway][lanes<2][!oneway][junction!=roundabout][junction!=circular] { throwWarning: tr("{0} together with {1} but without {2}", "{0.key}", "{1.key}<2", "{2.key}"); group: "MapThisWay (Highways)"; } /* mtw onelanenopassingplaces - Suggested by Andrea Musuruane */ way[highway][lanes<2][oneway=no][!passing_places] { throwWarning: tr("{0} together with {1} but without {2}", "{0.key}", "{1.key}<2", "{3.key}"); group: "MapThisWay (Highways)"; } /* mtw onelanelanemarkings */ way[highway][lanes<2][lane_markings=yes] { throwWarning: tr("{0} together with {1} and {2}", "{0.tag}", "{1.key}<2", "{2.tag}"); group: "MapThisWay (Highways)"; } /* mtw passingplacesmanylanes */ way[highway][lanes>=2][passing_places] { throwWarning: tr("{0} together with {1} and {2}", "{0.tag}", "{1.key}>=2", "{2.key}"); group: "MapThisWay (Highways)"; } /* mtw citylimitwithoutdirection */ way[highway][oneway!=yes] > node[traffic_sign=city_limit][!direction] { throwWarning: tr("{0} without {1}", "{1.key}"); group: "MapThisWay (Highways)"; } /* mtw citylimitwithoutcitylimit */ way[highway][oneway=yes] > node[traffic_sign=city_limit][!city_limit] { throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}"); group: "MapThisWay (Highways)"; } /* mtw trafficsingunconnected - suggested by Andrea Musuruane */ node:unconnected[traffic_sign=city_limit] { throwWarning: tr("isolated node which must be connected to a way"); group: "MapThisWay (Highways)"; } /******************************/ /* hiking.validator.mapcss */ /******************************/ /* mtw caiscaleonway */ way[inside("IT")][cai_scale] { throwWarning: tr("Unspecific tag {0}", "{1.key}: https://wiki.openstreetmap.org/wiki/Proposal:Cai_scale#Applies_to"); group: "MapThisWay (Hiking)"; fixRemove: "cai_scale"; } /* mtw unknowncaiscale */ relation[inside("IT")][cai_scale][cai_scale !~ /^(T|E|EE|EEA|EAI)$/] { throwWarning: tr("unusual value of {0}", "{1.tag}: https://wiki.openstreetmap.org/wiki/Proposal:Cai_scale#Examples"); group: "MapThisWay (Hiking)"; } /* mtw refrei */ relation[inside("IT")]["ref:REI"]["ref:REI" !~ /^((?:E(?:AL|AT|BI|CN|NO|TO|VB|VC)[A-Z][A-Z0-9]{3}[A-Z0-9])|(?:[A-DF-Z][A-Z]{2}[A-Z][A-Z0-9]{3}[A-Z0-9]))$/] { throwWarning: tr("unusual value of {0}", "{1.key}: https://wiki.openstreetmap.org/wiki/IT:Key:ref:REI"); group: "MapThisWay (Hiking)"; set invalid_ref_rei; } relation[inside("IT")]["ref:REI"] { set sentiero_cai; } /* mtw missingcairef */ relation[!ref].sentiero_cai!.invalid_ref_rei { throwWarning: tr("{0} without {1}", "Sentiero CAI", "{0.key}"); fixAdd: concat("ref=", substring(tag("ref:REI"), 4, 7), replace(substring(tag("ref:REI"), 7, 8), "0", "")); group: "MapThisWay (Hiking)"; } /* mtw invalidcairef */ relation[ref][tag(ref)!=concat(substring(tag("ref:REI"), 4, 7), replace(substring(tag("ref:REI"), 7, 8), "0", ""))].sentiero_cai!.invalid_ref_rei { throwError: tr("wrong value: {0}", "{0.tag}"); fixAdd: concat("ref=", substring(tag("ref:REI"), 4, 7), replace(substring(tag("ref:REI"), 7, 8), "0", "")); group: "MapThisWay (Hiking)"; } /* mtw unknowncaisourceref */ relation["source:ref"]["source:ref" !~ /^9[1-2][0-9]{5}$/].sentiero_cai { throwError: tr("wrong value: {0}", "{0.tag}"); group: "MapThisWay (Hiking)"; } /* mtw refalreadyonrel */ relation[type=route][route =~ /bicycle|mtb|foot|hiking|running/][ref] way[highway][tag("ref")=parent_tag("ref")] { throwWarning: tr("{0} is unnecessary for {1}", "ref", "{0.key}"); fixRemove: "ref"; group: "MapThisWay (Hiking)"; } /* mtw wrongroleguidepost - Suggested by Ivo Reano */ relation[type=route][route =~ /bicycle|mtb|foot|hiking|running/] >[role != "guidepost"] node[tourism=information][information=guidepost] { throwWarning: tr("{0} without {1}", "{1.value}", "role=guidepost"); group: "MapThisWay (Hiking)"; } /****************************/ /* landuses.validator.mapcss */ /****************************/ /* mtw farmyardwithoutfarm - Suggested by Andrea Musuruane */ node[place=farm] ⊈ area:closed2[landuse=farmyard] { throwWarning: tr("{0} without {1}", "{1.tag}", "place=farm"); group: "MapThisWay (Landuses)"; } /* mtw farmnotinsidefarmyard - Suggested by Andrea Musuruane */ area[landuse=farmyard] ⊉ node[place=farm] { throwWarning: tr("{0} without {1}", "{0.tag}", "landuse=farmyard"); group: "MapThisWay (Landuses)"; } /****************************/ /* natural.validator.mapcss */ /****************************/ node[inside("IT")][natural=tree][denotation=natural_monument], relation[inside("IT")][type=site][natural=tree_group][denotation=natural_monument] { set albero_monumentale; } /* mtw nomasaf */ *[!ref:masaf].albero_monumentale { throwWarning: tr("{0} without {1}", "Albero monumentale", "{0.key}"); group: "MapThisWay (Natural)"; } /* mtw nospecies - suggested by canfe */ node[!tag_regex("^species")].albero_monumentale { throwWarning: tr("{0} without {1}", "Albero monumentale", "species"); group: "MapThisWay (Natural)"; } /* mtw unknowntree */ *[inside("IT")][ref:masaf]!.albero_monumentale { throwWarning: tr("{0} on suspicious object", "{1.key}"); group: "MapThisWay (Natural)"; } /******************************/ /* phones.validator.mapcss */ /******************************/ /* mtw invalidphone */ *[inside("IT")][phone][phone !~ /^(?:(?:(?:\+39-0[0-9]{1,3}-[0-9]+)|(?:\+39 0[0-9]{1,3} [0-9]{3,}(?: [0-9]{4,})?)))(?:;(?:\+39-0[0-9]{1,3}-[0-9]+|(?:\+39 0[0-9]{1,3} [0-9]{3,}(?: [0-9]{4,})?)))*$/], *[inside("IT")]["contact:phone"]["contact:phone" !~ /^(?:(?:(?:\+39-0[0-9]{1,3}-[0-9]+)|(?:\+39 0[0-9]{1,3} [0-9]{3,}(?: [0-9]{4,})?)))(?:;(?:\+39-0[0-9]{1,3}-[0-9]+|(?:\+39 0[0-9]{1,3} [0-9]{3,}(?: [0-9]{4,})?)))*$/] { throwWarning: tr("unusual value of {0}", "{1.key}: https://wiki.openstreetmap.org/wiki/Key:phone#Italy"); group: "MapThisWay (Phones)"; assertNoMatch: "node phone=\"+39 0171 123456\""; assertNoMatch: "node phone=\"+39-0171-123456\""; assertNoMatch: "node phone=\"+39 0171 123 4567\""; assertNoMatch: "node phone=\"+39 0171 12345\""; assertNoMatch: "node phone=\"+39-0171-12345\""; assertNoMatch: "node phone=\"+39 02 12345\""; assertNoMatch: "node phone=\"+39 0171 12345678\""; assertMatch: "node phone=\"+39-0171-123 4567\""; assertMatch: "node phone=\"+39 0171-123456\""; assertMatch: "node phone=\"+39-0171 123456\""; assertMatch: "node phone=\"+45 0171 123 4567\""; assertMatch: "node phone=\"+39 0171-123 4567\""; assertNoMatch: "node \"contact:phone\"=\"+39 0171 123456\""; assertNoMatch: "node \"contact:phone\"=\"+39-0171-123456\""; assertNoMatch: "node \"contact:phone\"=\"+39 0171 123 4567\""; assertNoMatch: "node \"contact:phone\"=\"+39 0171 12345\""; assertNoMatch: "node \"contact:phone\"=\"+39-0171-12345\""; assertNoMatch: "node \"contact:phone\"=\"+39 02 12345\""; assertNoMatch: "node \"contact:phone\"=\"+39 0171 12345678\""; assertMatch: "node \"contact:phone\"=\"+39-0171-123 4567\""; assertMatch: "node \"contact:phone\"=\"+39 0171-123456\""; assertMatch: "node \"contact:phone\"=\"+39-0171 123456\""; assertMatch: "node \"contact:phone\"=\"+45 0171 123 4567\""; assertMatch: "node \"contact:phone\"=\"+39 0171-123 4567\""; assertNoMatch: "node phone=\"+39 0171 123456;+39 0171 123457\""; assertMatch: "node phone=\"+39 0171 123456,+39 0171 123457\""; assertNoMatch: "node \"contact:phone\"=\"+39 0171 123456;+39 0171 123457\""; assertMatch: "node \"contact:phone\"=\"+39 0171 123456,+39 0171 123457\""; } /* mtw invalidmobilephone */ *[inside("IT")]["contact:mobile"]["contact:mobile" !~ /^(?:(?:\+39-3[0-9]{2}-[0-9]{6,7})|(?:\+39 3[0-9]{2} [0-9]{6,7})|(?:\+39 3[0-9]{2} [0-9]{3} [0-9]{3,4}))(?:;(?:\+39-3[0-9]{2}-[0-9]{6,7}|(?:\+39 3[0-9]{2} [0-9]{6,7})|(?:\+39 3[0-9]{2} [0-9]{3} [0-9]{3,4})))*$/], *[inside("IT")]["phone:mobile"]["phone:mobile" !~ /^(?:(?:\+39-3[0-9]{2}-[0-9]{6,7})|(?:\+39 3[0-9]{2} [0-9]{6,7})|(?:\+39 3[0-9]{2} [0-9]{3} [0-9]{3,4}))(?:;(?:\+39-3[0-9]{2}-[0-9]{6,7}|(?:\+39 3[0-9]{2} [0-9]{6,7})|(?:\+39 3[0-9]{2} [0-9]{3} [0-9]{3,4})))*$/] { throwWarning: tr("unusual value of {0}", "{1.key}"); group: "MapThisWay (Phones)"; assertNoMatch: "node \"contact:mobile\"=\"+39 349 123456\""; assertNoMatch: "node \"contact:mobile\"=\"+39-349-123456\""; assertNoMatch: "node \"contact:mobile\"=\"+39 349 123 4567\""; assertNoMatch: "node \"contact:mobile\"=\"+39 349 123 456\""; assertMatch: "node \"contact:mobile\"=\"+39 349 1234 567\""; assertMatch: "node \"contact:mobile\"=\"+39 349 12345\""; assertMatch: "node \"contact:mobile\"=\"+39-349-12345\""; assertMatch: "node \"contact:mobile\"=\"+39 39 123456\""; assertMatch: "node \"contact:mobile\"=\"+39 444 12345\""; assertMatch: "node \"contact:mobile\"=\"+39-349-123 4567\""; assertMatch: "node \"contact:mobile\"=\"+39 349-123456\""; assertMatch: "node \"contact:mobile\"=\"+39-349 123456\""; assertMatch: "node \"contact:mobile\"=\"+45 349 123 4567\""; assertMatch: "node \"contact:mobile\"=\"+39 349-123 4567\""; assertMatch: "node \"contact:mobile\"=\"+39 349 12345678\""; assertNoMatch: "node \"phone:mobile\"=\"+39 349 123456\""; assertNoMatch: "node \"phone:mobile\"=\"+39-349-123456\""; assertNoMatch: "node \"phone:mobile\"=\"+39 349 123 4567\""; assertNoMatch: "node \"phone:mobile\"=\"+39 349 123 456\""; assertMatch: "node \"phone:mobile\"=\"+39 349 1234 567\""; assertMatch: "node \"phone:mobile\"=\"+39 349 12345\""; assertMatch: "node \"phone:mobile\"=\"+39-349-12345\""; assertMatch: "node \"phone:mobile\"=\"+39 39 123456\""; assertMatch: "node \"phone:mobile\"=\"+39 444 12345\""; assertMatch: "node \"phone:mobile\"=\"+39-349-123 4567\""; assertMatch: "node \"phone:mobile\"=\"+39 349-123456\""; assertMatch: "node \"phone:mobile\"=\"+39-349 123456\""; assertMatch: "node \"phone:mobile\"=\"+45 349 123 4567\""; assertMatch: "node \"phone:mobile\"=\"+39 349-123 4567\""; assertMatch: "node \"phone:mobile\"=\"+39 349 12345678\""; assertNoMatch: "node \"contact:mobile\"=\"+39 349 123456;+39-349-123457\""; assertMatch: "node \"contact:mobile\"=\"+39 349 123456,+39-349-123457\""; } /* mtw invalidtollfree */ *[inside("IT")]["contact:phone:IT"]["contact:phone:IT" !~ /^(?:8[0-9]{2}[- ][0-9]+)(?:;8[0-9]{2}[- ][0-9]+)*$/], *[inside("IT")]["phone:IT"]["phone:IT" !~ /^(?:8[0-9]{2}[- ][0-9]+)(?:;8[0-9]{2}[- ][0-9]+)*$/] { throwWarning: tr("unusual value of {0}", "{1.key}"); group: "MapThisWay (Phones)"; } /****************************/ /* schools.validator.mapcss */ /****************************/ /* mtw ischedit */ *[inside("IT")]["isced:level"]["isced:level" !~ /^[0-3]$/] { throwWarning: tr("unusual value of {0}", "{1.tag}: https://wiki.openstreetmap.org/wiki/Key:isced:level#Conversion_of_local_terms"); group: "MapThisWay (Schools)"; } *[inside("IT")]["isced:level"=0] { set scuola_infanzia; } *[inside("IT")]["isced:level"=1] { set scuola_elementare; } *[inside("IT")]["isced:level"=2] { set scuola_media; } *[inside("IT")]["isced:level"=3] { set scuola_superiore; } /* mtw scuolainfanzia */ *[amenity!=kindergarten].scuola_infanzia { throwWarning: tr("{0} without {1}", "Scuola Infanzia", "{0.tag}"); group: "MapThisWay (Schools)"; fixAdd: "amenity=kindergarten"; } /* mtw nidonotnursery */ *[amenity=kindergarten]["name" =~ /(?i)nido/][nursery!=yes].scuola_infanzia { throwWarning: tr("{0} without {1}", "{0.value}", "{2.tag}"); group: "MapThisWay (Schools)"; fixAdd: "nursery=yes"; } /* mtw scuolainfanzianoisced */ *[inside("IT")][amenity=kindergarten]!.scuola_infanzia { throwWarning: tr("{0} without {1}", "{1.tag}", "isced:level=0"); group: "MapThisWay (Schools)"; fixRemove: "isced:level"; fixAdd: "isced:level=0"; } /* mtw unkwnownschool */ *[inside("IT")][amenity=school]!.scuola_superiore!.scuola_media!.scuola_elementare!.scuola_infanzia { throwWarning: tr("{0} without {1}", "{1.tag}", "isced:level: https://wiki.openstreetmap.org/wiki/Key:isced:level#Conversion_of_local_terms"); group: "MapThisWay (Schools)"; } /* mtw ischiednoscuole */ *[amenity!=school][amenity!=kindergarten].scuola_elementare, *[amenity!=school][amenity!=kindergarten].scuola_media, *[amenity!=school][amenity!=kindergarten].scuola_superiore { throwWarning: tr("{0} without {1}", "Scuola", "{0.tag}"); group: "MapThisWay (Schools)"; fixAdd: "amenity=school"; } /* mtw schoolbadname */ *[amenity=kindergarten][name][name !~ /(?i)(scuola (materna|dell'infanzia))|asilo/].scuola_infanzia, *[amenity=school][name][name !~ /(?i)scuola (primaria|elementare)/].scuola_elementare, *[amenity=school][name][name !~ /(?i)scuola (media( inferiore)?)|(secondaria)/].scuola_media, *[amenity=school][name][name !~ /(?i)(istituto (magistrale|(di istruzione superiore)|tecnico|commerciale))|liceo/].scuola_superiore { throwWarning: tr("unusual value of {0}", "{2.key}"); group: "MapThisWay (Schools)"; } /* mtw schoolnoref */ *[inside("IT")][amenity=kindergarten][!ref], *[inside("IT")][amenity=school][!ref], *[inside("IT")][office=educational_institution][!ref] { throwWarning: tr("{0} without {1}", "{1.tag}", "{2.key}: cercare su https://unica.istruzione.gov.it/sic"); group: "MapThisWay (Schools)"; } *[inside("IT")][office=educational_institution] { set istituto_comprensivo; } /* mtw unknownschoolref */ *[ref][ref !~ /^[A-Z]{2}I[CS][A-Z0-9]{6}$/].istituto_comprensivo, *[ref][ref !~ /^[A-Z]{2}[1A]A[A-Z0-9]{6}$/].scuola_infanzia, *[ref][ref !~ /^[A-Z]{2}[1E]E[A-Z0-9]{6}$/].scuola_elementare, *[ref][ref !~ /^[A-Z]{2}[1M]M[A-Z0-9]{6}$/].scuola_media, *[ref][ref !~ /^[A-Z]{2}[A-Z0-9]{8}$/].scuola_superiore { throwError: tr("wrong value: {0}", "{0.tag}"); group: "MapThisWay (Schools)"; } /********************************/ /* unnecessary.validator.mapcss */ /********************************/ /* mtw amenitywithname */ *[inside("IT")][name][name=~/^(?i)(fontana)$/][amenity=fountain], *[inside("IT")][name][name=~/^(?i)(fontanella)$/][amenity=drinking_water], *[inside("IT")][name][name=~/^(?i)(lavatoio)$/][amenity=lavoir], *[inside("IT")][name][name=~/^(?i)(peso pubblico)$/][amenity=weighbridge], *[inside("IT")][name][name=~/^(?i)(gelateria)$/][amenity=ice_cream], *[inside("IT")][name][name=~/^(?i)(pizzeria)$/][tag(amenity)=="restaurant"||tag(amenity)=="fast_food"][cuisine~=pizza], *[inside("IT")][name][name=~/^(?i)(parco)$/][leisure=park], *[inside("IT")][name][name=~/^(?i)(laghetto)$/][water=pond], *[inside("IT")][name][name=~/^(?i)(parcheggio)$/][amenity=parking], *[inside("IT")][name][name=~/^(?i)(parco giochi)$/][leisure=playground], *[inside("IT")][name][name=~/^(?i)(area( per)? cani)$/][leisure=dog_park], *[inside("IT")][name][name=~/^(?i)(casa)$/][building=house], *[inside("IT")][name][name=~/^(?i)(municipio)$/][amenity=townhall], *[inside("IT")][name][name=~/^(?i)(ufficio postale)$/][amenity=post_office], *[inside("IT")][name][name=~/^(?i)(bar)$/][amenity=cafe], *[inside("IT")][name][name=~/^(?i)(panettiere|panetteria)$/][shop=bakery], *[inside("IT")][name][name=~/^(?i)(edicola)$/][shop=newsagent], *[inside("IT")][name][name=~/^(?i)(macelleria)$/][shop=butcher], *[inside("IT")][name][name=~/^(?i)(pasticceria)$/][shop=pastry], *[inside("IT")][name][name=~/^(?i)(ferramenta)$/][shop=hardware], *[inside("IT")][name][name=~/^(?i)(parrucchier[ae])$/][shop=hairdresser], *[inside("IT")][name][name=~/^(?i)(agenzia immobiliare)$/][office=estate_agent], *[inside("IT")][name][name=~/^(?i)(banca)$/][amenity=bank], *[inside("IT")][name][name=~/^(?i)(fermata (auto)?bus)$/][highway=bus_stop], *[inside("IT")][name][name=~/^(?i)(sentiero)$/][highway=path], *[inside("IT")][name][name=~/^(?i)(marciapiede)$/][highway=footway][footway=sidewalk], *[inside("IT")][name][name=~/^(?i)(cimitero)$/][amenity=grave_yard], *[inside("IT")][name][name=~/^(?i)(cimitero)$/][landuse=cemetery], *[inside("IT")][name][name=~/^(?i)(idrante)$/][emergency=fire_hydrant], *[inside("IT")][name][name=~/^(?i)(cancello)$/][barrier=gate], *[inside("IT")][name][name=~/^(?i)(monumento ai caduti)$/][historic=memorial][memorial=war_memorial] { throwWarning: tr("descriptive name"); group: "MapThisWay (Unnecessary)"; fixRemove: "name"; } /* the following without fixRemove to avoid information loss, should be checked manually */ *[inside("IT")][name][name=~/^(?i)(fontana|acqua potabile)$/][tag("amenity")=="drinking_water"||tag("drinking_water")=="yes"], *[inside("IT")][name][name=~/^(?i)(cappella)$/][tag("building")=="chapel"||tag("amenity")=="place_of_worship"] { throwWarning: tr("descriptive name"); group: "MapThisWay (Unnecessary)"; } /** * See: https://github.com/openstreetmap/iD/issues/7524 */ /* mtw busonwrongelement */ node[highway=bus_stop][bus=yes] { throwWarning: tr("{0} on suspicious object", "{1.tag}"); group: "MapThisWay"; fixRemove: "bus"; } /** * See: https://wiki.openstreetmap.org/wiki/Tag:highway%3Dbus_stop */ /* mtw busstopconnected */ way[highway] > node[highway=bus_stop] { throwWarning: tr("{0} node connected to a highway", "{0.tag}"); group: "MapThisWay"; } /* * See: https://wiki.openstreetmap.org/wiki/Key:parking:condition */ /* mtw oldparkingschema */ way[tag_regex("^parking:lane:(both|left|right)")] { throwWarning: tr("{0} is deprecated", "parking:lane:side"); group: "MapThisWay"; } /* mtw oldparkingconditionschema */ way[tag_regex("^parking:condition:(both|left|right)")] { throwWarning: tr("{0} is deprecated", "parking:condition:side"); group: "MapThisWay"; } /* mtw oldparkingleftno */ way["parking:lane:left"=no] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixChangeKey: "parking:lane:left => parking:left"; } /* mtw oldparkingrightno */ way["parking:lane:right"=no] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixChangeKey: "parking:lane:right => parking:right"; } /* mtw oldparkingbothno */ way["parking:lane:both"=no] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:both"; group: "MapThisWay"; fixChangeKey: "parking:lane:both => parking:both"; } /* mtw oldparkingrightparallel */ way["parking:lane:right:parallel"]["parking:lane:right:parallel" =~ /(half_on_kerb|on_kerb|street_side|shoulder)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixChangeKey: "parking:lane:right:parallel => parking:right"; fixAdd: "parking:right:orientation=parallel"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightparallelonstreet */ way["parking:lane:right:parallel"]["parking:lane:right:parallel" =on_street] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixAdd: "parking:right=lane"; fixAdd: "parking:right:orientation=parallel"; fixRemove: "parking:lane:right:parallel"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightparallelunknown */ way["parking:lane:right"=parallel][!"parking:lane:right:parallel"] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixAdd: "parking:right=yes"; fixAdd: "parking:right:orientation=parallel"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftparallel */ way["parking:lane:left:parallel"]["parking:lane:left:parallel" =~ /(half_on_kerb|on_kerb|street_side|shoulder)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixChangeKey: "parking:lane:left:parallel => parking:left"; fixAdd: "parking:left:orientation=parallel"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftparallelonstreet */ way["parking:lane:left:parallel"]["parking:lane:left:parallel" =on_street] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixAdd: "parking:left=lane"; fixAdd: "parking:left:orientation=parallel"; fixRemove: "parking:lane:left:parallel"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftparallelunknown */ way["parking:lane:left"=parallel][!"parking:lane:left:parallel"] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixAdd: "parking:left=yes"; fixAdd: "parking:left:orientation=parallel"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightperpendicular */ way["parking:lane:right:perpendicular"]["parking:lane:right:perpendicular" =~ /(half_on_kerb|on_kerb|street_side|shoulder)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixChangeKey: "parking:lane:right:perpendicular => parking:right"; fixAdd: "parking:right:orientation=perpendicular"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightperpendicularonstreet */ way["parking:lane:right:perpendicular"]["parking:lane:right:perpendicular" =on_street] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixAdd: "parking:right=lane"; fixAdd: "parking:right:orientation=perpendicular"; fixRemove: "parking:lane:right:perpendicular"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightperpendicularunknown */ way["parking:lane:right"=perpendicular][!"parking:lane:right:perpendicular"] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixAdd: "parking:right=yes"; fixAdd: "parking:right:orientation=perpendicular"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftperpendicular */ way["parking:lane:left:perpendicular"]["parking:lane:left:perpendicular" =~ /(half_on_kerb|on_kerb|street_side|shoulder)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixChangeKey: "parking:lane:left:perpendicular => parking:left"; fixAdd: "parking:left:orientation=perpendicular"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftperpendicularonstreet */ way["parking:lane:left:perpendicular"]["parking:lane:left:perpendicular" =on_street] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixAdd: "parking:left=lane"; fixAdd: "parking:left:orientation=perpendicular"; fixRemove: "parking:lane:left:perpendicular"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftperpendicularunknown */ way["parking:lane:left"=perpendicular][!"parking:lane:left:perpendicular"] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixAdd: "parking:left=yes"; fixAdd: "parking:left:orientation=perpendicular"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightdiagonal */ way["parking:lane:right:diagonal"]["parking:lane:right:diagonal" =~ /(half_on_kerb|on_kerb|street_side|shoulder)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixChangeKey: "parking:lane:right:diagonal => parking:right"; fixAdd: "parking:right:orientation=diagonal"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightdiagonalonstreet */ way["parking:lane:right:diagonal"]["parking:lane:right:diagonal" =on_street] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixAdd: "parking:right=lane"; fixAdd: "parking:right:orientation=diagonal"; fixRemove: "parking:lane:right:diagonal"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingrightdiagonalunknown */ way["parking:lane:right"=diagonal][!"parking:lane:right:diagonal"] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right"; group: "MapThisWay"; fixAdd: "parking:right=yes"; fixAdd: "parking:right:orientation=diagonal"; fixRemove: "parking:lane:right"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftdiagonal */ way["parking:lane:left:diagonal"]["parking:lane:left:diagonal" =~ /(half_on_kerb|on_kerb|street_side|shoulder)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixChangeKey: "parking:lane:left:diagonal => parking:left"; fixAdd: "parking:left:orientation=diagonal"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftdiagonalonstreet */ way["parking:lane:left:diagonal"]["parking:lane:left:diagonal" =on_street] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixAdd: "parking:left=lane"; fixAdd: "parking:left:orientation=diagonal"; fixRemove: "parking:lane:left:diagonal"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftdiagonalunknown */ way["parking:lane:left"=diagonal][!"parking:lane:left:diagonal"] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left"; group: "MapThisWay"; fixAdd: "parking:left=yes"; fixAdd: "parking:left:orientation=diagonal"; fixRemove: "parking:lane:left"; fixRemove: "parking:lane:both"; } /* mtw oldparkingleftdeprecatedtwice */ way["parking:lane:left" =~ /(no_parking|no_stopping|no_standing)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left:restriction"; group: "MapThisWay"; fixChangeKey: "parking:lane:left => parking:left:restriction"; } /* mtw oldparkingrightdeprecatedtwice */ way["parking:lane:right" =~ /(no_parking|no_stopping|no_standing)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right:restriction"; group: "MapThisWay"; fixChangeKey: "parking:lane:right => parking:right:restriction"; } /* mtw oldparkingbothdeprecatedtwice */ way["parking:lane:both" =~ /(no_parking|no_stopping|no_standing)/] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:both:restriction"; group: "MapThisWay"; fixChangeKey: "parking:lane:both => parking:both:restriction"; } /* mtw oldparkingleftticket */ way["parking:condition:left" = ticket] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left:fee=yes"; group: "MapThisWay"; fixAdd: "parking:left:fee=yes"; fixRemove: "parking:condition:left"; } /* mtw oldparkingrightticket */ way["parking:condition:right" = ticket] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right:fee=yes"; group: "MapThisWay"; fixAdd: "parking:right:fee=yes"; fixRemove: "parking:condition:right"; } /* mtw oldparkingbothticket */ way["parking:condition:both" = ticket] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:both:fee=yes"; group: "MapThisWay"; fixAdd: "parking:both:fee=yes"; fixRemove: "parking:condition:both"; } /* mtw oldparkingleftfree */ way["parking:condition:left" = free] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:left:fee=no"; group: "MapThisWay"; fixAdd: "parking:left:fee=no"; fixRemove: "parking:condition:left"; } /* mtw oldparkingrightfree */ way["parking:condition:right" = free] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:right:fee=no"; group: "MapThisWay"; fixAdd: "parking:right:fee=no"; fixRemove: "parking:condition:right"; } /* mtw oldparkingbothfree */ way["parking:condition:both" = free] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "parking:both:fee=no"; group: "MapThisWay"; fixAdd: "parking:both:fee=no"; fixRemove: "parking:condition:both"; } /** * See: https://wiki.openstreetmap.org/wiki/Tag:office%3Dtravel_agent */ /* mtw officetravelagent */ *[office=travel_agent] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "shop=travel_agency"; group: "MapThisWay"; fixRemove: "office"; fixAdd: "shop=travel_agency"; } /** * See: https://wiki.openstreetmap.org/wiki/Tag:shop%3Dlamps */ /* mtw shoplamps */ *[shop=lamps] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "shop=lighting"; group: "MapThisWay"; fixRemove: "shop"; fixAdd: "shop=lighting"; } /** * See: https://wiki.openstreetmap.org/wiki/Key:social_facility#Different_types_of_social_facilities */ /* mtw clinicnothealthcare */ *[social_facility][social_facility=healthcare] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "amenity=clinic"; group: "MapThisWay"; fixRemove: "social_facility"; fixAdd: "amenity=clinic"; } /** * See: https://wiki.openstreetmap.org/wiki/Key:wifi */ /* mtw wifiyes */ *[wifi=yes] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "internet_access=wlan"; group: "MapThisWay"; fixRemove: "wifi"; fixAdd: "internet_access=wlan"; } /* mtw wifino */ *[wifi=no] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "internet_access"; group: "MapThisWay"; fixChangeKey: "wifi => internet_access"; } /* mtw wififree */ *[wifi=free] { throwWarning: tr("{0} is deprecated", "{0.tag}"); suggestAlternative: "internet_access=wlan"; group: "MapThisWay"; fixRemove: "wifi"; fixAdd: "internet_access=wlan"; fixAdd: "internet_access:fee=no"; }