Version 5 (modified by 9 years ago) ( diff ) | ,
---|
Detect orthographic errors, name abbreviations, tags not suitable in Portugal and misused tags. Messages are in Portuguese only.
meta { title: "Português-Erros comuns PT2"; version: "1.38_2020-10-05"; description: "Encontra principalmente erros de ortografia, abreviaturas em nomes, algumas etiquetas não aplicáveis a Portugal e alguns erros de etiquetas mal aplicadas. Os erros começam com PT2 para serem facilmente identificados."; author: "Rui"; link: "http://josm.openstreetmap.de/wiki/Rules/Portuguese-Errors-PT2"; watch-modified: true; } *[name =~ /\s([dn]as?|[dn]os?|de)\s[a-z]/] { throwWarning: tr("PT2-Nome em minúscula após da,no,de..."); } *[name =~ /\s([DN]as?|[DN]os?|De)\s[a-zA-Z]|.*\sE\s.*/] { throwWarning: tr("PT2-Nome com maiúscula em Da,No,De,E..."); } *[name =~ /^[a-z]/] { throwWarning: tr("PT2-Nome que começa em minúscula"); } *[name =~ /\s\s/] { throwWarning: tr("PT2-Dois espaços em branco"); } *[name =~ /(?i)(sem\s?nome|fix\s?me|\bfix\b|nome|no\s?name|desconhecido|n(ã|a)o conhecido)/] { throwWarning: tr("PT2-Nome errado, sem nome..."); } way[highway][name =~ /(-Os-|\sos\s)/] { throwWarning: tr("PT2-O correto é -os-"); } way[highway][name =~ /(?i)(\bairport|bank|building|\bdrive\s?way|embassy|\bhelip(ort|ad)\b|\bPark(ing)?|Post\s?off?ice|\bRue\b|\bshop\b|\bstair|\btra(c?k|ck?)|stree?t|Zebra cros)/] { throwWarning: tr("PT2-Palavras por traduzir ou mudar a etiqueta"); } way[highway][name =~ /(Alf|Alm|Ant|Arq\.?º?|Az|B\.?º|Br|Bco?|Bl|Brg|Cac|Cc(nh)?|Ca[mp]|Csl|Cmdt|Comend|Cª|Cons|Cor|Cel|Dep|Dr?\.?ª|Dr|Dq|Edf?|Emb|Enf[oº]?|Eng[ºª]?|Esc(nh)?|Est|Gen|Hab|Inf|Im[aª]|Im[oº]?|Im|Jrd?|Lg?|Lj|Lt|Loteam|Lu?g|Mto|Maj|Mal|Mq|Me|Min|Mons|M|Pe|Pq|Part|Pe|Pto|P[cç]|Pr|Pct[aª]?|Presid|Pro?fª?|Proj|Prolng|Qd|\bR\.|Rot|Sarg|Slj|Soc|Scv|Sq|Ten|Tr|Transv|Trav|Trv|Tv|Urb|Vl|Visc|Vv|Zn)(\.| )/] { throwWarning: tr("PT2-Nome de estrada ou caminho abreviado"); } *[name =~ /(Ass|C(\.\s?|\s)?C|Av\.?ª?|B(\.\s?|\s)?V|B(\.\s?|\s)?E(\.\s?|\s)?S|\bCongr|\bD|\bDir|\b[FSfs](\.\s?|\s)?[Cc](lub)?e?|[Cc](\.\s?|\s)?[Gg](\.\s?|\s)?[Dd]|C(\.\s?|\s)?V(\.\s?|\s)?P|[Bb](\.\s?|\s)?[Vv]|[Cc](\.\s?|\s)?[Mm]|[Ee](\.\s?|\s)?[Bb]|E[\.\s]?T[\.\s]?A[\.\s]?R|N[^0-9º]|\bH|Inst|N(\.\s?|\s)?[ªa]|Ns|Qta|P(\.\s?|\s)?S(\.\s?|\s)?P|Rib\.?[aª]?|\bR|S(\.\s?|\s)?C|St\.?[oaºª]?|S|Sra?|Sr?\.?ª|Univ|\bOf|\bJ(\.\s?|\s)?F)(\.|\s)/] [name !~ /(?i)\bS\.A\.\b/] {{ throwWarning: tr("PT2-Nome abreviado"); } *[name =~ /[?!.,:;]{2,}/] { throwWarning: tr("PT2-Pontuação repetida 2 ou mais vezes"); } *[name =~ /([`´~^¨]|\s['"»«ºª]\s)/] { throwWarning: tr("PT2-Acentuação isolada entre espaços"); } *[name =~ /(?i).*(\bá\s|hà|\bAb[ìi]lio|Ac([àa]c|ass?|áss?)i[ao]|Academic[oa]|A((c|ss?)[ùu]|çù)de\b|\bAss?ore[sa]|Administra(ça|cã|ca)o|Africa\b|Ag(enc|êns)ia|Agrari[ao]|Agricola|\bAguas?|Alcantara|Alvar(es|o)|Amalia|\bAmeli[ao]\b|Americ[ao]s?\b|\bAndre\b|\bAngel[ao]\b|Anibal|Apolonia|Araujo|Arma(ze|sé)(m|ns)|Arqueol(og|ój|oj)ic[oa]|Arvore|Ascen(sao|ção|çao)|\bAsenha\b|Astronomico|\bA[sc]is\b|Ass?o(c|ss?)ia(ça|cã|ca)o|Americo|Antonio|Araujo|Atlantic|Atletico|Auditorio|\bBaia\b|B(as|áz)i(li)?c[ao]|\bBarao\b|\bBarbar[ao]s?\b|\bB[éê]co\b|Belem\b|B(élj|el[gj]i)c|Bonanico|Bonif(ac|as|ás)io|\bBrazil|Britanic|Cafe\b|Caf(ét[ea]|ata)ria|Cal(c|ss?)ada|C(alva|álv[áa])rio|Cambio|cami(onaj|no[gj]|nona[gj]|na[gj])em|Camara|Camelia|Camoes|\bCandid[ao]\b|\bC[aâ]o\b|Capitao|Ca[cs]s?ador|Cemiterio|C(e[zs]|éz)ar|\bCha[os]?\b|\bCidadao\b|Ci(enc|[êe]nss?)ia|\bClaudi[ao]|Clerigo|Clinica|Col(eg|éj)io|Com(er[cs]|érs)io|\bCaza\b|Comunitari|Concei(ca|ça|cã)o|Comdominio|\bC[oô]nego\b|Con([cs]s?ervato|cervató)ri|Coperativa|Crist([oôó]va|[oô]vã)o|\bCrus\b|Con(c|ss?)ervatori[oa]|Dalia|\bDamiao\b|Dan(c|ss?)a\b|Dentari|Dep(oss?|óz|oz)ito|Diario|\bDili\b|Dion(is|iz|íz)io|Dire(cã|ça|ca)o|\bE(c|ss?)ca\b|Educa(ca|ça|cã)o|\bElec?tric[ao]s?|\b\b([ÈÉ]m[íi]|Emi)di[ao]\b|\bEmili[ao]\b|Encarna(ca|ça|cã)o|Escadori|Escoteiro|Espirito|Esta(ca|ça|cã)o|\bEstadio|Estasiona|Esternato|Estetica|Estevao|Estradao|Est[êée]vao|\bEufemi|Evan(ge|jé|je)lica|\bEvora\b|Ex(erc|érs)ito|\bEx(ilio|ílad)|Fabricas?\b|\bFamilia\b|(para)?Farmacia|Fatima|Felix|\bFerre[ao]|Ferr?oviari|Finan(c|ss?)as|\bFisic[ao]\b|\bFlavi[ao]\b|\bFlôr(es)?\b|\bFont(ana|en[áa])rio|\bFontaínha|Fortalesa|Fran(ce|sê|se)s\b|Fruticula|Funeraria|Gale\b|Garces|\bGa(rret|rett?)\b|\b(Ge|J[ée])meos?\b|Gloria|\bGôa\b|\bGois\b|Gon(c|ss?)alves|\bGra[cs]s?as?\b|\bGrao\b|Guestao|Guimaraes|Gu?in(áz|as|az)io|Gu?ina[sz]tica|Guine\b|Hermini[ao]\b|Herois|\bHor(áss?|ac)io|Horten[cs]ia|Horticula|Iberic[ao]|\bIn([áa]ss?|ac)io|Independencia|India\b|Industria\b|Inf(a[cs]s?ia|ânss?ia|antario)|\binformatica|\bIn(es|ez|êz)\b|Infantario|Informatica|\bIrmao?s?\b|Jeronimo|Joao|Joelheria|\bJoias?\b|Jose\b|Judi(cia|ss?i[áa])ria|\bJulia?o\b|Laboratorio|L(ás|az|as)aro|Leao|Leitao|\bLirio|Lo(gi|jí)stic|Loule|Louren(c|ss?)o|\bL(ú[çs]s?i|u[çcs]s?i)[ao]\b|Lu[sz]iada|Magalhaes|\bMarili|Maritim[oa]|\bMario\b|Martir(es)?\b|\bMatris\b|Marqu?(é[sz]|eza)\b|Matematic|Ma?c\sDonald('|\s)?s|\bMedic[oa]\b|Mi(ss?iona|cion[áa])ri|M(i[sz]erico|e[sz]irec[oó])rdia|Mortuaria|\bM(o[zs]|uz)eu\b|Muni((c|ss?)i|ss?í)pio|Musica\b|\bMuzeu\b|\bNautic|\bNa(zare|sar[ée])|Nem(éz|es)io\b|Ne[sç]s?e[scç]s?idades|Not(i[cs]s?|íss?)ias|\bNucleo\b|\bOp?tica\b|[ÒO]bidos?|Observatorio|(Oceanic[ao]\b|O[çs]s?eânic)|\bOperari[oa]s?\b|Orqu?idea|Ortigao|Ourive(rs|z)aria|O(zó|so|zo)rio|Pal(ac|áss?|ass?)io|\bPao\b|\bPara(i[zs]o|ízo)|\bPar(óq|óquial|oqu?ia)\b|Pa(ss?adi[sc]s?|çadi[sç]s?)o|\bPatio\b|Patrias?\b|Patr(i[cs]|ís)i[ao]|Pavilhao|Pedag(og|ój)ic[ao]|Pediatric|Peninsula\b|Pen(çã|ss?a|ssã)o|Peniten(cia|ss?i[áa])ri?|\bPeras?\b|Picina|Platano|Poli(c|ss?)ia|Porfirio|\bPoss?os?\b\bPovoas?\b|\bPra(c|ss?)a\b|Pra(ç|ss?)eta|Preparatori|Pre([sz]ide|zidê)ncia|Pr((inc|ins|íns)[ie]|ínce)pe|Primari(o|a)|P(siquia|ciqui[aá])tric[oa]|Politecnic|Porfirio|Portugue[sz]\b|Profi[cs]ional|\bProgre[sç]o|\bPublic(o|a)|P[ou]rifica(ca|ça|cã)o|\bQueiro[sz]|Quiteria|\bRadio\b|\bRaínha\bRaúl\b|Ress?into|\bR[eu]tunda\b|\bRe(gia|jiã|gi|ji)o\b|Remedio|R[ée]publica\b|Re([zs]ide|zidê)n[cs]ias?\b|Re(zide|sidê)n[cs]ial|Re[sç]urrei(ça|[cs]s?ã)o|Ress?urrei(ça|[cs]s?ã)o|Retrozaria|\bRío\b|Rodoviari[oa]|Romao|\bRo(sa|za|zá)ri[oa]|Ruina|\bSa\b|Salao|\bSanitari|Sant(are|er[ée])m|\bSao\b|\bSaude|\sSe\b|Sebastiao|Seculo|Secundaria|(Semina|Cemin[áa])rio|Senior|Sepulveda|S(erg|érji)io|Sidonio|Simoes|Su(e(c|ss?)ia|éss?)ia|Su(íss?|iç|iss?)a|Su[çs]s?e(ss?|ç)o|\bT(ang|[âa]nj)er\b|Taxis?|Tecnico|Tecnol(ój|o[gj])ico|\bTenis\b|Tertulia|Teofilo|Teotonio|\bTilia|\bTomas\b|\bTome\b|\bTr(a[sz]|áz)\b|\bTr?ave[sç]a\b|\bTunel\b|\bTuristic|\bUniao\b|Univer(sita|cit[áa])ri|Univercidade|Urbani(za(ç|ss?)ao|sa(ç|ss?)ão|zac[aã]o)|Urg(enc|[êe]nss?)ia|\bV(ar[zs]|árs)ea\b|\bVarsim|\bV(árs|ar[zs])ea|\bV(ir[gj]i|jí|erj[íi]|ergi)li|Veter(i?na|en[áa])ri|\bVilaret?\b|Vitoria|Voluntario).*/] { throwWarning: tr("PT2-Verificar:Nome com erros ortográficos"); } *[shop=books][name =~ /^(?i)\bBiblioteca\b/] { throwWarning: tr("PT2-Biblioteca com etiqueta de livraria"); suggestAlternative: "amenity=library"; } *[amenity=library][name =~ /^(?i)\bLivraria\b/] { throwWarning: tr("PT2-Livraria com etiqueta de biblioteca"); suggestAlternative: "shop=books"; } way[railway = rail][lanes][!tracks] { throwWarning: tr("PT2- railway não deve ter lanes mas sim tracks"); fixChangeKey: "lanes => tracks"; } *[amenity=grave_yard] { throwWarning: tr("PT2-Verificar: é muito raro sepulturas fora de cemitérios, usar cemetery"); } *[place][place != village][name =~ /^Freguesia\b/] { throwWarning: tr("PT2-A etiqueta de uma freguesia deve ser village"); fixAdd: "place=village"; } way[highway !~ /^(primary|trunk)/][name =~ /^(?i)(Estrada Nacional|EN)\s/], way[highway !~ /^(primary|trunk)/][ref =~ /^(?i)(E\.?)?N(\.|\s)?[0-9]{1,3}$/] { throwWarning: tr("PT2-Estradas nacionais devem ser primárias/VR/IP/IC"); fixAdd: "highway=primary"; } way[highway !~ /^secondary/][name =~ /^(?i)(Estrada Regional|ER)\s/], way[highway !~ /^secondary/][ref =~ /^(?i)(E\.?)?R(\.|\s)?[0-9]{1,4}$/] { throwWarning: tr("PT2-Estradas regionais devem ser secundárias"); fixAdd: "highway=secondary"; } way[highway !~ /^tertiary/][name =~ /^(?i)((Estrada|Caminho) Municipal|EM|CM)\s/], way[highway !~ /^tertiary/][ref =~ /^(?i)([EC]\.?)?M(\.|\s)?[0-9]{1,4}$/] { throwWarning: tr("PT2-Estradas municipais devem ser terciárias"); fixAdd: "highway=tertiary"; } *[highway=mini_roundabout] { throwWarning: tr("PT2-Verificar: mini-rotundas são raras, será 1 rotunda?"); } node[junction=roundabout] { throwWarning: tr("PT2-Rotunda num nó, é melhor num círculo"); } node[amenity = place_of_worship] ∈ *[building] { throwWarning: tr("PT2- local de oração num nó, sobre 1 edifício"); } node[amenity = place_of_worship] { throwWarning: tr("PT2- local de oração num nó, é melhor um edifício"); } *[amenity != recycling][name =~ /(?i)\b(ecoponto|vidrão|pilhão)\b/] { throwWarning: tr("PT2- ecoponto no nome mas sem etiqueta de ecoponto"); } *[amenity != fire_station][name =~ /(?i)\b(Bombeiros|Quartel dos B|\bBatalhão|Sapadores)\b/][name !~ /(?i)\b(Alameda|Avenida|Beco|Calçad(inh)?a|Caminho|Escad(a|inha|aria)s?|Estrada|Ladeira|Largo|Pátio|Pra(ç|cet)a|Rotunda|Rua|Terreiro|Transversal|Travessa|Viela) dos (Bombeiros|Quartel dos B|\bBatalhão|Sapadores)\b/] { throwWarning: tr("PT2-Bombeiros no nome mas sem etiqueta"); } /* Locais, Juntas, Câmaras, Ecopontos... numa linha, normalmente estradas */ node:connection[amenity = recycling], node:connection[place =~ /(village|city|town|locality)/] { throwWarning: tr("PT2- {0} deve estar isolado e não numa linha", "{1.tag}"); } /* Locais, Juntas, Câmaras, Ecopontos... numa linha, normalmente estradas */ node[shop] ∈ way , node[amenity = recycling] ∈ way , node[place] ∈ way { throwWarning: tr("PT2-Vários tipos de nós que devem estar isolados e não numa linha", "{1.tag}"); } /* RegExp provenientes e adaptadas de http://josm.openstreetmap.de/wiki/Rules/Brazilian-Specific */ *[designation] { throwWarning: tr("PT2- {0} não se aplica em Portugal", "{0.key}"); suggestAlternative: "description"; suggestAlternative: "name"; } *[highway=living_street] { throwWarning: tr("PT2- {0} não se aplica em Portugal", "{0.value}"); suggestAlternative: "residential"; fixAdd: "highway=residential"; } *[highway=bridleway] { throwWarning: tr("PT2- bridleway não se aplica em Portugal, use highway=path"); } *[amenity=biergarten] { throwWarning: tr("PT2- amenity=biergarten não se aplica em Portugal, use amenity=pub"); } *[leisure=common] { throwWarning: tr("PT2- leisure=common não se aplica em Portugal"); } *[railway=monorail] { throwWarning: tr("PT2-Não existem monocarris em Portugal, será carris?"); } *[wikipedia][wikipedia !~ /^pt:/] { throwWarning: tr("PT2-Usar prefixo em português (pt:) em {0}", "{0.key}"); } /* nomes e ruas escritos totalmente em maiúsculo */ *[name =~ /^[A-Z0-9]*[A-Z]+[A-Z0-9]*$/], *["addr:street" =~ /^[A-Z0-9]*[A-Z]+[A-Z0-9]*$/] { throwWarning: tr("PT2-Verificar: {0} com letras apenas em maiúsculo", "{0.key}"); suggestAlternative: "short_name"; } /* nomes com valores que provavelmente deveriam estar em alt_name, short_name, etc */ *[name =~ /.*\(.*\).*/] { throwWarning: tr("PT2- {0} com parênteses", "{0.key}"); suggestAlternative: "alt_name"; suggestAlternative: "short_name"; suggestAlternative: "description"; suggestAlternative: "note"; } *[name =~ /.* - .*/] { throwWarning: tr("PT2- {0} com traço", "{0.key}"); suggestAlternative: "alt_name"; suggestAlternative: "short_name"; suggestAlternative: "description"; } *[name =~ /.*, .*/][name !~ /.*, (Lda|S\.A)\./] { throwWarning: tr("PT2- {0} com vírgula", "{0.key}"); suggestAlternative: "alt_name"; suggestAlternative: "short_name"; suggestAlternative: "description"; suggestAlternative: "note"; } *[name =~ /.*: .*/] { throwWarning: tr("PT2- {0} com dois pontos", "{0.key}"); suggestAlternative: "alt_name"; suggestAlternative: "short_name"; suggestAlternative: "description"; suggestAlternative: "note"; } /* utilizar ; como separador de valores em source */ *[source =~ /.*,.*/], *["source:ref" =~ /.*,.*/], *["source:name" =~ /.*,.*/] { throwWarning: tr("PT2-Utilizar ; como separador de valores em {0}", "{0.key}"); } /* nome e referências iguais */ *[name = *ref][highway] { throwWarning: tr("PT2- {0} e {1} são iguais; adicionar nome completo da estrada", "{0.key}", "{0.value}"); } /* possui nome de rua mas não tem etiqueta de highway */ *[!highway][route != road][type !~ /route|street/][name][name =~ /^(?i)(Auto-?estrada|Avenida|Beco|Calçad(inh)?a|Caminho|Ciclovia|Escad(a|inha|aria)s?|Estrada\s?(Nacional|Regional|Municipal)?|Itinerário\s? (Complementar|Principal)?|Passeio|Rotunda|Rua|Transversal|Travessa|Trilho|Túnel|Variante|Via(-|\s)Rápida|Viadutos?|Viela) .*/][name !~ /^(?i)estrada de ferro/] { throwWarning: tr("PT2-Verificar: com nome de via mas sem etiqueta de {0}", "{0.key}"); } *[highway][name =~ /^(?i)(Auto-?Estrada|Alameda|Avenida|Beco|Calçad(inh)?a|Caminho|Ciclovia|Escad(a|inha|aria)s?|Estrada\s?(Nacional|Regional|Municipal)?|Itinerário\s? (Complementar|Principal)?|Ladeira|Largo|Pátio|Pra(ç|cet)a|Rotunda|Rua|Transversal|Travessa|Terreiro|Trilho|Túnel|Variante|Via(-Rápida)?|Viadutos?|Viela)( (de acesso|sem nome|projetad(a|o)|em construção))?$/] { throwWarning: tr("PT2-Via com nome incompleto"); } /* endereços com nome de via errado */ *["addr:street"]["addr:street" !~ /^(Alameda|Avenida|Beco|Calçad(inh)?a|Caminho|Campus|Circular|Condomínio|Escad(a|inha|aria)s?|Estrada|Itinerário\s?|Jardi(m|ns)|Ladeira|Largo|Loteamento|Pátio|Pra(ç|cet)a|Quinta|Rotunda|Rua|Terreiro|Transversal|Travessa|Urbanização|Variante|Via|Viela) .*/] { throwWarning: tr("PT2- {0} sem nome de via, errado, abreviado ou maiúsculas", "{0.key}"); } /* nome de vias sem logradouro correto */ *[highway=cycleway][name][name !~ /^(?i)ciclovia .*/], *[highway][highway !~ /bridleway|bus_stop|cycleway|crossing|footway|give_way|motorway_junction|path|raceway|speed_camera|steps|stop/][name][name !~ /^(Auto-?Estrada|Alameda|Avenida|Beco|Calçad(inh)?a|Caminho|Circular Regional Exterior|Escad(a|inha|aria)s?|Estrada|Itinerário|Ladeira|Largo|Loteamento|Pátio|Ponte|Pra(ç|cet)a|Rotunda|Rua|Terreiro|Transversal|Travessa|Túnel|Variante|Via(-Rápida)?|Viaduto|Viela) .*/] { throwWarning: tr("PT2- {0} sem nome de via, errado, abreviado ou maiúsculas", "{0.key}"); } /* estrada com identificador mas sem o nome real */ *[name = *ref][highway] { throwWarning: tr("PT2- {0} e {1} são iguais; adicionar nome completo da via", "{0.key}", "{0.value}"); } way[highway][type = route] { throwWarning: tr("PT2- {0} não deve possuir {1}", "{0.key}", "{1.tag}"); } relation[type = route][highway] { throwWarning: tr("PT2-Relação não deve possuir {0}", "{1.key}"); } /* nomes desnecessários */ *[designation = *"addr:housename"], *[ref = *designation], *[ref = *old_ref], *[name = *"addr:housename"], *[name = *designation], *[name = *alt_name], *[name = *int_name], *[name = *loc_name], *[name = *nat_name], *[name = *official_name], *[name = *old_name], *[name = *reg_name], *[name = *short_name], *[name = *sorting_name] { throwWarning: tr("PT2- {0} e {1} são iguais; remover chave {1} desnecessária", "{0.key}", "{0.value}"); fixRemove: "{0.value}"; } *[place = city][!name], *[place = town][!name], *[place = village][!name] { throwWarning: tr("PT2- {0} sem nome", "{0.value}"); } *[amenity =~ /^(school|college|kindergarten|driving_school)$/][name =~ /^(?i)\b(Academia da Força Aérea|Academia Militar|Academia Nacional Superior|Conservatório Superior|Faculdade|Escola d[eo] Serviço de Saúde Militar|Escola Náutica Infante|Escola Naval|Escola Superior|Escola Universitária|Instituto de Ciências Biomédicas|Instituto de Engenharia|Instituto Militar|Instituto Politécnico|Instituto Português de Administração|Instituto Superior|Instituto Universitário|Universidade)\b/] { throwWarning: tr("PT2-Verificar:estabelecimento de ensino errado"); suggestAlternative: "amenity=university"; } *[amenity =~ /^(university|college|kindergarten|driving_school)$/][name =~ /^(?i)\b(Escola|Agrupamento de Escolas|Liceu|Centro de Formação Profissional)\b/][name !~ /^(?i)\b(Escola d[eo] Serviço de Saúde Militar|Escola Náutica Infante|Escola Naval|Escola Superior|Escola Universitária)\b/] { throwWarning: tr("PT2-Verificar:estabelecimento de ensino errado"); suggestAlternative: "amenity=school"; } *[amenity =~ /^(university|college|kindergarten|driving_school)$/][name =~ /^(?i)\b(Escola|Agrupamento de Escolas|Liceu|Centro de Formação Profissional)\b/][name !~ /^(?i)\b(Escola d[eo] Serviço de Saúde Militar|Escola Náutica Infante|Escola Naval|Escola Superior|Escola Universitária)\b/] { throwWarning: tr("PT2-Verificar:estabelecimento de ensino errado"); suggestAlternative: "amenity=school"; } *[amenity =~ /^(university|school|kindergarten|driving_school)$/][name =~ /^(?i)\b(Colégio|Internato|Real Colégio)\b/] { throwWarning: tr("PT2-Verificar:estabelecimento de ensino errado"); suggestAlternative: "amenity=college"; } *[amenity =~ /^(university|school|college|driving_school)$/][name =~ /^(?i)\b(creche|jardim infantil|jardim de infância|infantário|externato)\b/] { throwWarning: tr("PT2-Verificar:estabelecimento de ensino errado"); suggestAlternative: "amenity=kindergarten"; } *[amenity =~ /^(university|school|college|kindergarten)$/][name =~ /^(?i)\bEscola de Condução\b/] { throwWarning: tr("PT2-Verificar:estabelecimento de ensino errado"); suggestAlternative: "amenity=driving_school"; fixAdd: "{0.key}=driving_school"; } *[amenity = university] ∈ *[amenity = university], *[amenity = university] ∈ *[amenity = college], *[amenity = university] ∈ *[amenity = school] { throwWarning: tr("PT2- {0} dentro de {1}", "amenity=university", "{0.tag}"); } *[amenity = college] ∈ *[amenity = college] { throwWarning: tr("PT2- {0} dentro de {1}", "amenity=college", "{0.tag}"); } *[amenity = school] ∈ *[amenity = school] { throwWarning: tr("PT2- {0} dentro de {1}", "amenity=school", "{0.tag}"); } *[name =~ /(?i)\bHelipo[rn]to?\b/][aeroway][aeroway != helipad], *[name =~ /^(?i)Subestação .*/][power][power != substation], *[name =~ /^(?i)Tribunal .*/][amenity][amenity != courthouse], *[name =~ /^(?i)(Hospital|Centro Hospitalar) .*/][building][building != hospital], *[name =~ /^(?i)(Universidade|Faculdade) .*/][building][building != university], *[name =~ /^(?i)Escola .*/][building][building != school], *[name =~ /^(?i)(Aparthotel|Hotel|Residencial|Pensão) .*/][building][building != hotel], *[name =~ /(?i)\bMotel\b/][tourism][tourism != motel], *[name =~ /(?i)\bRestaurante?\b/][amenity][amenity != restaurant], *[name =~ /(?i)\bMuseu?\b/][tourism][tourism != museum], *[name =~ /(?i)\bBiblioteca?\b/][amenity][amenity != library], *[name =~ /(?i)\b(Supermercado|Mini-?Mercado|Hipermercado)\b/][shop][shop != supermarket], *[name =~ /(?i)\bPadandaria\b/][shop][shop != bakery], *[name =~ /(?i)\bTalho\b/][shop][shop != butcher], *[name =~ /(?i)\bSapataria\b/][shop][shop != shoes], *[name =~ /(?i)\b(Joalharia|Ourivesaria)\b/][shop][shop != jewelry], *[name =~ /(?i)\b(Cabeleireir[ao]|Barbe(iro|aria))\b/][shop][shop != hairdresser], *[name =~ /(?i)\bCentro de Cópias\b/][shop][shop != copyshop], *[name =~ /(?i)\bPeixaria\b/][shop][shop != seafood], *[name =~ /(?i)\bLoja de Tecidos\b/][shop][shop != fabric], *[name =~ /(?i)\bLoja de Informática\b/][shop][shop != computer], *[name =~ /(?i)\bSalão de Beleza\b/][shop][shop != beauty], *[name =~ /(?i)\bFlorista\b/][shop][shop != florist], *[name =~ /(?i)\bViveiros\b/][landuse][landuse != plant_nursery], *[name =~ /(?i)\bLavandaria\b/][shop][shop != laundry], *[name =~ /(?i)\b(Centro Comercial|Shopp?ing Cent(er|re))\b/][shop][shop != mall], *[name =~ /(?i)\bDroguaria\b/][shop][shop != chemist], *[name =~ /(?i)\b(Stande?|Automóveis)\b/][shop][shop != car], *[name =~ /(?i)\b(Represa|Açude)\b/][waterway][waterway != weir], *[name =~ /(?i)\b(Queda de Água|Cascata|Catarata)s?\b/][waterway][waterway != waterfall], *[name =~ /^(?i)Barragem\b/][waterway][waterway != dam], *[name =~ /^(?i)Albufeira\b/][waterway][waterway != reservoir], *[name =~ /(?i)\bAgência de Viagens\b/][shop][shop != travel_agency], *[name =~ /(?i)\bBanco\b/][amenity][amenity != bank], *[name =~ /(?i)\b((Caixa\s)?ATM|Caixa Multi-?Banco|MB)\b/][amenity][amenity != atm], *[name =~ /(?i)\bPapelaria\b/][shop][shop != stationery], *[name =~ /(?i)\b(Agência\s)?Funerária\b/][shop][shop != funeral_directors], *[name =~ /(?i)\bPraia\b/][natural][natural != beach], *[name =~ /(?i)\b(E\.?T\.?A\.?R\.?|Estração de Tratamento de Águas Residuais)\b/][man_made][man_made != wastewater_plant], *[name =~ /(?i)\b(Clínica Veterinária|Veterinário)\b/][amenity][amenity != veterinary], *[name =~ /(?i)\b(Clínica Dentária|Dentista)\b/][amenity][amenity != dentist], *[name =~ /(?i)\b(CTT|Correios)\b/][amenity][amenity != post_office], *[name =~ /(?i)\bBombeiros\b/][amenity][amenity != fire_station], *[name =~ /(?i)\b(Polícia|G\.?N\.?R\.?|P\.?S\.?P\.?)\b/][amenity][amenity != police], *[name =~ /(?i)\b(Prisão|Prisional)\b/][amenity][amenity != prison], *[name =~ /(?i)\b(Embaixada|Consulado)\b/][amenity][amenity != embassy], *[name =~ /(?i)\bTeatro\b/][amenity][amenity != theatre], *[name =~ /(?i)\bCinema\b/][amenity][amenity != cinema], *[name =~ /^(?i)Café\b/][amenity][amenity != cafe], *[name =~ /(?i)(Ma?c\s?Donald('|\s)?s/|Burgu?er\s?(Qu|K)ing)][amenity][amenity != fast_food], *[name =~ /^(?i)Parque de Campismo\b/][amenity][amenity != camp_site], *[name =~ /(?i)\b(Pousada|hostel)\b/][amenity][amenity != hostel], *[name =~ /(?i)\bCemitério\b/][landuse][landuse != cemetery], *[name =~ /^(?i)Capela .*/][building][building != chapel], *[name =~ /^(?i)Igreja .*/][building][building != church], *[name =~ /^(?i)Catedral .*/][building][building != cathedral], *[name =~ /^(?i)(Fazenda|Quinta) .*/][building][building != farm], *[name =~ /^(?i)(Supermercado|Hipermercado|Minimercado) .*/][building][building != supermarket] { throwWarning: tr("PT2- {0} provavelmente deveria ser {1}", "{2.key}", "{2.value}"); fixAdd: "{2.key}={2.value}"; } *[name =~ /^(?i)Clínica.*/][amenity != clinic][name !~ /^(?i)Clínica (Veterin|Dent)ária.*/] { throwWarning: tr("PT2-Clínicas devem ser amenity=clinic"); } *[name =~ /(?i)(Junta de Freguesia|Câmara Municipal).*/][name !~ /(?i)(Rua|Avenida|Travessa) da (Junta de Freguesia|Câmara Municipal).*/][amenity != townhall] { throwWarning: tr("PT2-Juntas de Freguesia e Câmaras Municipais devem ser amenity=townhall"); fixAdd: "amenity=townhall"; } *[leisure][name =~ /^(?i)(campo|est(á|a)dio) (de (futebol|desportos?)|desportivo)?$/], *[leisure][name =~ /^(?i)(estádio|(Pavilhão )?)Gimnodesportivo$/] { throwWarning: tr("PT2-Nome supérfluo/incompleto de local de lazer"); } /* nomes e ruas escritos totalmente em maiúsculo */ *[name =~ /^[A-Z0-9]*[A-Z]+[A-Z0-9]*$/], *["addr:street" =~ /^[A-Z0-9]*[A-Z]+[A-Z0-9]*$/] { throwWarning: tr("PT2-Verificar: {0} com letras apenas em maiúsculo", "{0.key}"); suggestAlternative: "short_name"; } /* Erro comum como Rua do CRuzeiro */ *[name =~ /(.*)?[A-Z]{2}[a-z].*/], *["addr:street" =~ /(.*)?[A-Z]{2,}[a-z].*/] { throwWarning: tr("PT2-Verificar: nome ou endereço com 2 letras seguidas em maiúsculo"); } /* lugar possui nome que inicia com "Edifício" mas não possui etiqueta building */ *[name =~ /^(?i)edifício.*/][!building] [name !~ /^(?i)\bEdifício Transparente\b/] { throwWarning: tr("PT2-Possível ausência de etiqueta {0}", "{1.key}"); fixAdd: "building=yes"; } *["addr:postcode"]["addr:postcode" !~ /[0-9]{4}-[0-9]{3}/], *[postal_code][postal_code !~ /[0-9]{4}-[0-9]{3}/] { throwWarning: tr("PT2- {0} (código postal) em formato diferente de NNNN-NNN", "{0.key}"); } *[highway]["addr:postcode"] { throwWarning: tr("PT2- {0} deve ser postal_code em {1}", "{1.key}", "{0.key}"); fixChangeKey: "{1.key} => postal_code"; } node[surface] { throwWarning: tr("PT2-Superfície ({0}) num nó", "{0.key}"); fixRemove: "{0.key}"; } /* highway/waterway com layer negativo e sem túnel */ *[highway][layer < 0][!tunnel], *[waterway][layer < 0][!tunnel] { throwWarning: tr("PT2-Verificar: {0} negativo de {1} com ausência de {2}", "{1.key}", "{0.key}", "{2.key}"); } /* highway/waterway com layer positivo e sem ponte */ *[highway][layer > 0][!bridge][highway != bus_stop], *[waterway][layer > 0][!bridge] { throwWarning: tr("PT2-Verificar: {0} positivo de {1} com ausência de {2}", "{1.key}", "{0.key}", "{2.key}"); } way[highway = motorway_junction] { throwError: tr("PT2- {0} deve ser utilizado apenas no nó de saída da estrada", "{0.tag}"); suggestAlternative: "highway=motorway_link"; } way[highway][lanes][lanes !~ /^[1-9]([0-9]*)$/], way[highway]["lanes:backward"]["lanes:backward" !~ /^[1-9]([0-9]*)$/], way[highway]["lanes:forward"]["lanes:forward" !~ /^[1-9]([0-9]*)$/] { throwError: tr("PT2- {0} deve ser um valor inteiro", "{1.key}"); } /* estradas de 2 vias mas apenas com 1 faixa estão provavelmente erradas */ *[highway][lanes = 1][!oneway?][!junction] { throwWarning: tr("PT2- {0} provavelmente deveria ter {1} ≥ 2 ou {2}=yes", "{0.key}", "{1.key}", "{2.key}"); } /* admin_level deve ficar na relação e não no nó do local */ node[place][admin_level] { throwWarning: tr("PT2- {0} deve fazer parte do limite administrativo e não do nó do local", "{1.key}"); } relation[admin_level][!boundary], relation[admin_level][boundary][boundary != administrative] { throwError: tr("PT2- {0} ausência de boundary=administrative", "{0.key}"); fixAdd: "boundary=administrative"; } relation[boundary=administrative][!admin_level] { throwError: tr("PT2- {0} deve possuir {1}", "{0.tag}", "{1.key}"); } relation[boundary=administrative] > way { set way_in_relation; } relation[admin_level] > way { set way_in_relation; } way[boundary=administrative][!admin_level]!.way_in_relation { throwError: tr("PT2- {0} deve possuir {1}", "{0.tag}", "{1.key}"); } way[admin_level][!boundary]!.way_in_relation, way[admin_level][boundary][boundary != administrative]!.way_in_relation { throwError: tr("PT2- {0} ausência de boundary=administrative", "{0.key}"); fixAdd: "boundary=administrative"; } relation[boundary=administrative][type=multipolygon] { throwError: tr("PT2-Relação deve ser do tipo ''type=boundary''"); fixAdd: "type=boundary"; } node[destination], relation[destination][type != waterway] { throwWarning: tr("PT2- {0} deve-se usar apenas em linhas", "{0.key}"); } /* landuse não deve ter layer */ *[landuse][layer] { throwWarning: tr("PT2-Verificar: {0} não deve ter {1}", "{0.key}", "{1.key}"); } /* path deve utilizar trail_visibility e não tracktype */ way[highway = path][tracktype] { throwWarning: tr("PT2-Uso incorreto de {0}", "{1.key}"); suggestAlternative: "trail_visibility"; } /* tracktype é uma propriedade de tracks apenas */ way[highway != track][tracktype] { throwWarning: tr("PT2-Utilizar {0} apenas em {1}={2}", "{1.key}", "{0.key}", "{0.value}"); } /* número de saída de rodovia */ *[highway=motorway_junction][ref][ref !~ /^[0-9]+( |-)*([A-Z])?$/] { throwWarning: tr("PT2-Saída de via ({0}) fora do padrão", "{1.key}"); } *[alt_ref] { throwWarning: tr("PT2-O conteúdo de {0} deve fazer parte de ref, separado por ;", "{0.key}"); suggestAlternative: "ref"; } *[name =~ /^(?i)pra(ç|cet)a .*/][!leisure][landuse = grass] { throwWarning: tr("PT2-Possível definição errada de praça: {0}", "{2.tag}"); suggestAlternative: "leisure=park"; } *[highway][highway !~ /construction|give_way|motorway_junction|proposed|raceway|speed_camera|stop/][!wheelchair], *[building][!wheelchair] { throwOther: tr("PT2- {0} sem etiqueta de acessibilidade ({1})", "{0.key}", "{1.key}"); } *[route = ferry][!duration] { throwWarning: tr("PT2-Ausência do tempo de duração ({0}) da balsa", "{1.key}"); } *[highway = service][!service] { throwOther: tr("PT2-Ausência do tipo de serviço ({0}) na {1}", "{1.key}", "{0.key}"); } *[highway = track][!tracktype] { throwOther: tr("PT2-Ausência do tipo de track ({0}) na {1}", "{1.key}", "{0.key}"); } /* número de faixas apenas para rodovias maiores e links */ way[highway =~ /motorway|trunk|primary|secondary|tertiary/][!lanes], way[highway $= _link][!lanes] { throwOther: tr("PT2- {0} sem número de faixas ({1}) definido", "{0.key}", "{1.key}"); } way[highway][!surface][highway != bus_stop] { throwOther: tr("PT2- {0} sem superfície ({1}) definida", "{0.key}", "{1.key}"); } way[highway = motorway_junction] { throwError: tr("PT2- {0} deve ser utilizado apenas no nó de saída da via", "{0.tag}"); suggestAlternative: "highway=motorway_link"; } /* layer não faz sentido em outros objetos */ *[layer][!building][!highway][man_made!=pipeline][tunnel!][!railway][!waterway] { throwWarning: tr("PT2-Verificar: possível uso incorreto de {0} no objeto", "{0.key}"); } /* https://github.com/OSMBrasil/validador-josm/issues/54 */ /* requer JOSM ≥ 7761 */ *[tourism = motel][amenity != love_hotel], *[name =~ /(?i)\bmotel\b/][amenity != love_hotel] { throwWarning: tr("PT2-Ausência de etiqueta ''{0}''", "{1.value}"); fixAdd: "{1.key}={1.value}"; } *[amenity = love_hotel][tourism][tourism != motel] { throwWarning: tr("PT2-Verificar: provavelmente deve ser ''{0}={1}''", "{2.key}", "{2.value}"); } /* é bom especificar o tipo de torre */ node[man_made = tower][!"tower:type"] { throwOther: tr("PT2-Ausência do tipo de torre ({0})", "{1.key}"); } *["building:levels"][!building] { throwWarning: tr("PT2- {0} sem etiqueta {1}", "{0.key}", "{1.key}"); } *["building:levels" < 1] { throwWarning: tr("PT2-Verificar: {0} com valor inválido", "{0.key}"); } /* deve-se utilizar short_name, name ou official_name ao invés de long_name */ *[long_name] { throwWarning: tr("PT2-Chave inválida: {0}", "{0.key}"); suggestAlternative: "highway=name"; suggestAlternative: "highway=short_name"; suggestAlternative: "highway=official_name"; } /* landuse deve conter algum valor que não seja yes */ *[landuse?] { throwWarning: tr("PT2-Especificar valor correto para {0} em vez de ''{1}''", "{0.key}", tag("landuse")); } /* vários valores para source devem estar na mesma chave, separados por ';' */ *[alt_source][source] { throwWarning: tr("PT2- {0} deve estar incluído em {1}, separado por '';'' caso necessário", "{0.key}", "{1.key}"); } *[access = permissive] { throwWarning: tr("PT2-Verificar: {0} só deve ser usado em vias privadas com permissão de acesso e não vias públicas", "{0.tag}"); } *[aeroway][designation =~ /^[A-Z]{4}$/][!icao], *[aeroway][ref =~ /^[A-Z]{4}$/][!icao] { throwWarning: tr("PT2- {0} provavelmente deve ser utilizado como {1}", "{1.key}", "{2.key}"); fixChangeKey: "{1.key} => {2.key}"; } *[crossing][!highway][!railway] { throwWarning: tr("PT2- {0} deve ser utilizado com {1}={0} ou {2}={0}", "{0.key}", "{1.key}", "{2.key}"); } node[highway=speed_camera][!maxspeed], relation[enforcement=maxspeed][!maxspeed], relation[enforcement=maxheight][!maxheight], relation[enforcement=maxweight][!maxweight] { throwWarning: tr("PT2-Adicionar {0} ao {1}", "{1.key}", "{0.tag}"); } node[highway =~ /^(give_way|mini_roundabout|stop|turning_circle)$/][name] { throwWarning: tr("PT2-Objeto não deve possuir {0}", "{1.key}"); } way[highway = give_way], way[highway = mini_roundabout], way[highway = stop], way[highway = turning_circle], relation[highway = give_way], relation[highway = mini_roundabout], relation[highway = stop], relation[highway = turning_circle] { throwWarning: tr("PT2- {0} deve ser utilizado apenas em nós", "{0.tag}"); } /* torres de energia, lombas, câmaras, semáforos etc que não estão ligados a numa via */ node:unconnected[power = pole], node:unconnected[power = tower], node:unconnected[highway = speed_camera] { throwWarning: tr("PT2- {0} deve fazer parte de uma via e não isolado", "{1.tag}"); } *[iata = "0"] { throwWarning: tr("{0} com valor = {1}", "{0.key}", "{0.value}"); } /* saídas de estradas devem ter nome e/ou referência */ node[highway = motorway_junction][!name][!ref] { throwWarning: tr("PT2- {0} sem pelo menos uma das etiquetas: {1} ou {2}", "{0.value}", "{1.key}", "{2.key}"); } /* provalvemente o tipo dessas vias não deve ser link */ *[highway $= _link][name =~ /(Alameda|Avenida|Rua|Travessa|Viela) .*/] { throwWarning: tr("PT2-Verificar: via possivelmente errada com {0}", tag("highway")); } node[noname?] { throwWarning: tr("PT2-Verificar: uso suspeito de {0} num nó", "{0.key}"); } /* source estranhamente igual o name */ *[source = *name] { throwWarning: tr("PT2-Verificar: {0} e {1} são iguais", "{0.key}", "{0.value}"); } /* AVISOS INFORMATIVOS */ /* é útil ter o destino das saídas de estradas */ *[highway = motorway_link][!destination] { throwOther: tr("PT2- {0} sem etiqueta {1}", "{0.value}", "{1.key}"); } *[place = city][!population], *[place = town][!population], *[place = village][!population] { throwOther: tr("PT2- {0} sem etiqueta de população", "{0.value}"); } *[place][place !~ /hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population < 10000] { throwOther: tr("PT2-Verificar: local com <10.000 hab. deve ser village, EXCEPTO sedes de freguesia!"); fixAdd: "place=village"; } *[place =~ /city|hamlet|isolated_dwelling|village/][population >= 10000][population < 100000] { throwOther: tr("PT2-Verificar: local com 10.000-100.000 hab. deve ser town, EXCEPTO sedes de concelho!"); fixAdd: "place=town"; } *[place =~ /hamlet|isolated_dwelling|town|village/][population >= 100000] { throwOther: tr("PT2-Verificar: local com +100.000 hab. deve ser city, EXCEPTO capitais de distrito!"); fixAdd: "place=city"; }
Rules_Portuguese-Errors-PT2.validator.mapcss, Rules_Portuguese-Errors-PT2.zip
Note:
See TracWiki
for help on using the wiki.