From fbfbf93e281609e413091c92386da130ee46aeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Rodrigo?= Date: Mon, 4 Mar 2019 23:01:15 +0100 Subject: [PATCH] mapcss: update from josm mapcss #467 --- mapcss/item_map.py | 53 +- plugins/Josm_Rules_Brazilian_Specific.py | 2676 +++++++++++++--------- plugins/Josm_combinations.py | 150 +- plugins/Josm_de_openrailwaymap.py | 10 +- plugins/Josm_deprecated.py | 549 ++++- plugins/Josm_geometry.py | 79 +- plugins/Josm_numeric.py | 61 + plugins/Josm_openrailwaymap.py | 88 + plugins/Josm_territories.py | 13 +- plugins/Josm_unnecessary.py | 16 + 10 files changed, 2507 insertions(+), 1188 deletions(-) diff --git a/mapcss/item_map.py b/mapcss/item_map.py index aea894081..6898c22ab 100644 --- a/mapcss/item_map.py +++ b/mapcss/item_map.py @@ -68,30 +68,32 @@ 'item': 9018, 'only_for': ['BR'], 'prefix': 'Josm_', - 'subclass_blacklist': [1063481013, - 1290837584, - 1992839086, - 386880794, - 1843994632, - 1582438505, - 557015301, - 523931624, - 1406083581, - 1652729911, - 176141455, - 1930177472, - 112286739, - 969441033, - 338682039, - 807344112, - 965336283, - 1532674501, - 659472938, - 1956052894, - 373443518, - 698950828, - 645857049, - 1234269468], + 'subclass_blacklist': [339470124, + 995006835, + 1594044971, + 226394604, + 2012241162, + 1322492249, + 1123790420, + 951501764, + 1948798798, + 733725137, + 2074305530, + 282605167, + 39095837, + 1154433213, + 1415734409, + 58812649, + 1354724892, + 2146320716, + 1840875080, + 1508736498, + 877403916, + 1322492249, + 481849808, + 1279481357, + 200264401, + 200264401], 'tags': ['tag']}, 'Seamark': {'class': {'In {0} {1}={2} require {3}={4}': 9012009, 'Multi-colour {0} without {1}': 9012001, @@ -169,7 +171,7 @@ 'uncommon short key': 9002012, 'wrong value: {0}': 9002019, '{0} = {1}; remove {0}': 9002009, - '{0} is inaccurate': 9002013, + '{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.': 9002013, '{0} is not recommended. Use the Reverse Ways function from the Tools menu.': 9002016, '{0} is unspecific. Instead use the key fixme with the information what exactly should be fixed in the value of fixme.': 9002006, '{0} should be replaced with {1}': 9002008, @@ -274,6 +276,7 @@ 'tracks=1 not necessary if detail=track is tagged.': 9015015, 'usage=freight is deprecated': 9015005, '{0} identification should be tagged as ref, not as name': 9015039, + '{0}={1} without name': 9015044, '{0}={1} without {2}:railway': 9015027}, 'item': 9015, 'prefix': 'Josm_', diff --git a/plugins/Josm_Rules_Brazilian_Specific.py b/plugins/Josm_Rules_Brazilian_Specific.py index eec09828a..5e85a97e4 100644 --- a/plugins/Josm_Rules_Brazilian_Specific.py +++ b/plugins/Josm_Rules_Brazilian_Specific.py @@ -25,7 +25,6 @@ def init(self, logger): self.errors[9018012] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))} self.errors[9018013] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} self.errors[9018014] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))} - self.errors[9018015] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic')} self.errors[9018016] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'SAMU classificado de forma errada')} self.errors[9018017] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'objeto não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))} self.errors[9018018] = {'item': 9018, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} @@ -66,6 +65,7 @@ def init(self, logger): self.re_044c8944 = re.compile(ur'^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)') self.re_04873a60 = re.compile(ur'^(river|stream)$') self.re_05a345c7 = re.compile(ur'^(forest|grass|greenfield|meadow|orchard)$') + self.re_066203d3 = re.compile(ur'^[0-9]+$') self.re_073e5345 = re.compile(ur'\b[A-Z]{2,3} (- )?[0-9]{2,3}\b') self.re_07f31a73 = re.compile(ur'^(living_street|pedestrian|residential|road|service|track)$') self.re_0b27200b = re.compile(ur'(?i)^s(\.|-| )?\/?n\.?º?$') @@ -76,6 +76,7 @@ def init(self, logger): self.re_12b48afb = re.compile(ur'^(grassland|heath|scrub|wood)$') self.re_131cc885 = re.compile(ur' ou ') self.re_139e342b = re.compile(ur'(?i)^Helipo(n|r)to.*') + self.re_13f4c147 = re.compile(ur'(?i)(?u)^paço\b') self.re_152c10ee = re.compile(ur'hamlet|isolated_dwelling|town|village') self.re_15690541 = re.compile(ur'^(?i)estrada de ferro') self.re_160d1bfc = re.compile(ur'^(?i)creche\b') @@ -86,12 +87,15 @@ def init(self, logger): self.re_20c7dd98 = re.compile(ur'^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$') self.re_20cf30ba = re.compile(ur'^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|rodovia|rotatória|rua|travessa|trevo|viela) .*') self.re_20fc5143 = re.compile(ur'^(?i)Bairro\b') + self.re_243f4993 = re.compile(ur'^(\+55|0800)') self.re_280004fd = re.compile(ur'^(Água|Arroio|Cabeceira|Córrego|Furo|Grota|Igarapé|Lajeado|Paraná|Restinga|Riacho|Ribeirão|Rio|Sanga)\b') + self.re_292e0bb5 = re.compile(ur'(?i)\b[0-9]+ ?m?\b') self.re_2cd1e949 = re.compile(ur'^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)') self.re_2dbaea13 = re.compile(ur'^(?i)\bSAMU\b') self.re_2e8e4f2b = re.compile(ur'(?i)google') self.re_2fcb6bab = re.compile(ur'^(?i)ciclovia .*') self.re_2ffc377d = re.compile(ur'.* D(a|e|o)s? .*') + self.re_31732cd0 = re.compile(ur'(?i)(?u)^(Brasilg(á|a)s|Consigaz|Copagaz|Liquig(á|a)s|Minasg(á|a)s|Nacional G(á|a)s|Supergasbras|Ultragaz)$') self.re_35bb0f2f = re.compile(ur'^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b') self.re_362f879f = re.compile(ur'college|school') self.re_375e3de4 = re.compile(ur'.*([A-Z]{2,3}-[0-9]{2,4}|SPM(-| )[0-9]{3} ?(D|E)?|SP(A|D|I)(-| )[0-9]{3}\/[0-9]{3}|[A-Z]{3}-[0-9]{3}\/[0-9]{3}).*') @@ -99,18 +103,18 @@ def init(self, logger): self.re_39d67968 = re.compile(ur'^[a-z].*') self.re_3aeda39d = re.compile(ur'hamlet|island|isolated_dwelling|neighbourhood|suburb|village') self.re_3b304b9b = re.compile(ur'(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b') - self.re_3b777b9d = re.compile(ur'^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*') self.re_3eb0ab44 = re.compile(ur'clinic|doctors|hospital') + self.re_408831d0 = re.compile(ur'^(br|bR|Br)[0-9]{14}$') self.re_46ab4d8d = re.compile(ur'^(?i)(?u)c(â|a)mara\b') self.re_4a8ca94e = re.compile(ur'^(?i)(?u)praça.*') self.re_4bd3b925 = re.compile(ur'^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$') self.re_4cf86823 = re.compile(ur'(?i)\bsaude\b') + self.re_524288b6 = re.compile(ur'^BR[0-9]{14}$') self.re_52ab3b8b = re.compile(ur'^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$') self.re_53abc074 = re.compile(ur'^(give_way|mini_roundabout|stop|turning_circle)$') self.re_568a42f4 = re.compile(ur'\b[A-Z]{2,4} (- )?[0-9]{2,3}\b') self.re_57b8ef8e = re.compile(ur'_[0-9]$') self.re_57bee688 = re.compile(ur'^[0-9]{5}( |\.)[0-9]{3}$') - self.re_57eb9fe5 = re.compile(ur'^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodoanel|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*') self.re_5849be19 = re.compile(ur'^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*') self.re_58f616c9 = re.compile(ur'^(city_block|farm|hamlet|island|islet|isolated_dwelling|neighbourhood|square)$') self.re_591572a5 = re.compile(ur'city|hamlet|isolated_dwelling|village') @@ -118,21 +122,28 @@ def init(self, logger): self.re_5ac7053e = re.compile(ur'^(1(a|b)?|[1-9][0-9]?)$') self.re_5cd37790 = re.compile(ur'(?i)^motel\b') self.re_5d3348cb = re.compile(ur'city|farm|neighbourhood|suburb|town|village') + self.re_5ddbb7eb = re.compile(ur'^[0-9]{2}\.[0-9]{3}\.[0-9]{3}\/[0-9]{4}-[0-9]{2}$') self.re_6024a566 = re.compile(ur'(?i)^Aer(ódromo|oporto) de.*') self.re_604bb645 = re.compile(ur'(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b') + self.re_60ad6838 = re.compile(ur'^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Calçadão|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodoanel|Rodovia|Rotatória|Rótula|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*') self.re_6416be64 = re.compile(ur'^(island|islet)$') self.re_64387998 = re.compile(ur'^(?i)Bairro d(a|e|o)s?\b') self.re_6566db6a = re.compile(ur'(?i).*heliport$') self.re_65710fdb = re.compile(ur'(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)') self.re_667ce569 = re.compile(ur'^(?i)(?u)((via de )?(acesso|ligação)(( (a|à))? propriedade)?|entrada|entroncamento|rampa|retorno|rotat(ó|o)ria|r(ó|o)tula|sa(í|i)da|trevo|estrada( municipal| de terra)?|rua|rodovia|via)( (de acesso|sem nome|projetad(a|o)))?$') + self.re_67c67cf2 = re.compile(ur'^[0-9]+0$') self.re_6b6e390d = re.compile(ur'(Alameda|Avenida|Rua|Travessa|Viela) .*') + self.re_6bf570a0 = re.compile(ur'^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Calçadão|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*') self.re_6c0d6e9e = re.compile(ur'school|university') + self.re_6e34cd0f = re.compile(ur'(?i)\bcoreto\b') self.re_6efb8049 = re.compile(ur'(?i).*airport$') self.re_72d45155 = re.compile(ur'route|street') self.re_7633bf4e = re.compile(ur'Rodovia ([A-Z]{2,3}-[0-9]{2,4})') self.re_793b22ec = re.compile(ur'^(?i)(?u)c((â|a)me|ama)ra\b') + self.re_7a246e93 = re.compile(ur'^(100|18{0,1}|19[0-9])$') self.re_7afc6883 = re.compile(ur'^[A-Z]{4}$') self.re_7b7c453d = re.compile(ur'^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*') + self.re_7ec1fb9a = re.compile(ur'(?i)^prefeitura\b') self.re_7f53e992 = re.compile(ur'^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$') @@ -142,1151 +153,1199 @@ def node(self, data, tags): err = [] - # *["addr:street"]["addr:street"!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/] + # *["addr:street"]["addr:street"!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Calçadão|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/][inside("BR")] if (u'addr:street' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b777b9d), mapcss._tag_capture(capture_tags, 1, tags, u'addr:street'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6bf570a0), mapcss._tag_capture(capture_tags, 1, tags, u'addr:street')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com logradouro ausente, errado ou abreviado","{0.key}") - err.append({'class': 9018001, 'subclass': 588331445, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018001, 'subclass': 279840772, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[!highway][route!=road][!public_transport][type!~/route|street/][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*/][name!~/^(?i)estrada de ferro/] + # *[!highway][route!=road][!public_transport][type!~/route|street/][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*/][name!~/^(?i)estrada de ferro/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (not mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'road') and not mapcss._tag_capture(capture_tags, 2, tags, u'public_transport') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_72d45155), mapcss._tag_capture(capture_tags, 3, tags, u'type')) and mapcss._tag_capture(capture_tags, 4, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 6, self.re_15690541), mapcss._tag_capture(capture_tags, 6, tags, u'name'))) + try: match = (not mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'road') and not mapcss._tag_capture(capture_tags, 2, tags, u'public_transport') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_72d45155), mapcss._tag_capture(capture_tags, 3, tags, u'type')) and mapcss._tag_capture(capture_tags, 4, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 6, self.re_15690541), mapcss._tag_capture(capture_tags, 6, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto com nome de via mas sem tag de {0}","{0.key}") - err.append({'class': 9018002, 'subclass': 874993957, 'text': mapcss.tr(u'objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 535280341, 'text': mapcss.tr(u'objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/] + # *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4bd3b925), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4bd3b925), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("utilizar espaço ao invés de underscore") - err.append({'class': 9018002, 'subclass': 378801374, 'text': mapcss.tr(u'utilizar espaço ao invés de underscore')}) + err.append({'class': 9018002, 'subclass': 1476954926, 'text': mapcss.tr(u'utilizar espaço ao invés de underscore')}) - # *[name=~/(?i)(^|.* )(Cel|Cmte|Cond|Conj|Dª|Dr|Eng|Gov|Hab|Jd|Jr|Marg|Mun|p\/|Pde|Pe|Pq|Pst|Pref|Profa|Profª|Prof|Res|s\/|Sr(a|ª)?|Sta|Sto|Ver)\.? .*/] + # *[name=~/(?i)(^|.* )(Cel|Cmte|Cond|Conj|Dª|Dr|Eng|Gov|Hab|Jd|Jr|Marg|Mun|p\/|Pde|Pe|Pq|Pst|Pref|Profa|Profª|Prof|Res|s\/|Sr(a|ª)?|Sta|Sto|Ver)\.? .*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_178f5446), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_178f5446), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("palavra abreviada em {0}","{0.key}") - err.append({'class': 9018003, 'subclass': 1784756763, 'text': mapcss.tr(u'palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018003, 'subclass': 749019091, 'text': mapcss.tr(u'palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/] + # *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/][inside("BR")] if (u'leisure' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome supérfluo/incompleto de local de lazer") - err.append({'class': 9018004, 'subclass': 790401825, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de lazer')}) + err.append({'class': 9018004, 'subclass': 1485441713, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de lazer')}) - # *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/] + # *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_52ab3b8b), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_52ab3b8b), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome supérfluo/incompleto de local de saúde") - err.append({'class': 9018005, 'subclass': 1792576894, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de saúde')}) + err.append({'class': 9018005, 'subclass': 1497769259, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de saúde')}) - # *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/] + # *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ab76b11), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ab76b11), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("erro de ortografia em ''saúde''") - err.append({'class': 9018002, 'subclass': 1455303428, 'text': mapcss.tr(u'erro de ortografia em \'\'saúde\'\'')}) + err.append({'class': 9018002, 'subclass': 1962359328, 'text': mapcss.tr(u'erro de ortografia em \'\'saúde\'\'')}) - # *[place=farm][name^="Sitio "] + # *[place=farm][name^="Sitio "][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'farm') and mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, u'name'), mapcss._value_capture(capture_tags, 1, u'Sitio '))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'farm') and mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, u'name'), mapcss._value_capture(capture_tags, 1, u'Sitio ')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("faltando acento em ''Sítio''") - err.append({'class': 9018002, 'subclass': 962677162, 'text': mapcss.tr(u'faltando acento em \'\'Sítio\'\'')}) + err.append({'class': 9018002, 'subclass': 653860263, 'text': mapcss.tr(u'faltando acento em \'\'Sítio\'\'')}) - # *[name=~/^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$/] + # *[name=~/^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_20c7dd98), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_20c7dd98), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("local com nome supérfluo, incompleto ou descritivo") - err.append({'class': 9018002, 'subclass': 501162763, 'text': mapcss.tr(u'local com nome supérfluo, incompleto ou descritivo')}) + err.append({'class': 9018002, 'subclass': 1104230922, 'text': mapcss.tr(u'local com nome supérfluo, incompleto ou descritivo')}) - # *[amenity=parking][name=~/(?i)^Estacionamento /] + # *[amenity=parking][name=~/(?i)^Estacionamento /][inside("BR")] # Rule Blacklisted - # *[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] + # *[designation=*"addr:housename"][inside("BR")] + # *[ref=*designation][inside("BR")] + # *[ref=*old_ref][inside("BR")] + # *[name=*"addr:housename"][inside("BR")] + # *[name=*designation][inside("BR")] + # *[name=*alt_name][inside("BR")] + # *[name=*int_name][inside("BR")] + # *[name=*loc_name][inside("BR")] + # *[name=*nat_name][inside("BR")] + # *[name=*official_name][inside("BR")] + # *[name=*old_name][inside("BR")] + # *[name=*reg_name][inside("BR")] + # *[name=*short_name][inside("BR")] + # *[name=*sorting_name][inside("BR")] if (u'designation' in keys) or (u'name' in keys) or (u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_ref'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_ref')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'alt_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'alt_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'int_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'int_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'loc_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'loc_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'nat_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'nat_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'official_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'official_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'reg_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'reg_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'short_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'short_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'sorting_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'sorting_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} e {1} são iguais; remover chave {1} desnecessária","{0.key}","{0.value}") # fixRemove:"{0.value}" - err.append({'class': 9018006, 'subclass': 1882388489, 'text': mapcss.tr(u'{0} e {1} são iguais; remover chave {1} desnecessária', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 2003922, 'text': mapcss.tr(u'{0} e {1} são iguais; remover chave {1} desnecessária', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}')), 'allow_fix_override': True, 'fix': { '-': ([ mapcss._tag_uncapture(capture_tags, u'{0.value}')]) }}) - # *[source=*name] + # *[source=*name][inside("BR")] if (u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} e {1} são iguais","{0.key}","{0.value}") - err.append({'class': 9018002, 'subclass': 1403015964, 'text': mapcss.tr(u'{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 470146003, 'text': mapcss.tr(u'{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/] + # *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_65710fdb), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_65710fdb), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto com nomenclatura incorreta") # suggestAlternative:"noname" - err.append({'class': 9018007, 'subclass': 506924923, 'text': mapcss.tr(u'objeto com nomenclatura incorreta')}) + err.append({'class': 9018007, 'subclass': 1272098213, 'text': mapcss.tr(u'objeto com nomenclatura incorreta')}) - # node[maxheight][barrier!=height_restrictor][!traffic_sign] - # node[maxspeed][highway!=speed_camera][!traffic_sign] + # node[maxheight][barrier!=height_restrictor][!traffic_sign][inside("BR")] + # node[maxspeed][highway!=speed_camera][!traffic_sign][inside("BR")] if (u'maxheight' in keys) or (u'maxspeed' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'maxheight') and mapcss._tag_capture(capture_tags, 1, tags, u'barrier') != mapcss._value_capture(capture_tags, 1, u'height_restrictor') and not mapcss._tag_capture(capture_tags, 2, tags, u'traffic_sign')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'maxheight') and mapcss._tag_capture(capture_tags, 1, tags, u'barrier') != mapcss._value_capture(capture_tags, 1, u'height_restrictor') and not mapcss._tag_capture(capture_tags, 2, tags, u'traffic_sign') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'maxspeed') and mapcss._tag_capture(capture_tags, 1, tags, u'highway') != mapcss._value_capture(capture_tags, 1, u'speed_camera') and not mapcss._tag_capture(capture_tags, 2, tags, u'traffic_sign')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'maxspeed') and mapcss._tag_capture(capture_tags, 1, tags, u'highway') != mapcss._value_capture(capture_tags, 1, u'speed_camera') and not mapcss._tag_capture(capture_tags, 2, tags, u'traffic_sign') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} não deve ser utilizado em nó; utilizar a restrição na via","{0.key}") - err.append({'class': 9018008, 'subclass': 1663448238, 'text': mapcss.tr(u'{0} não deve ser utilizado em nó; utilizar a restrição na via', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018008, 'subclass': 427326608, 'text': mapcss.tr(u'{0} não deve ser utilizado em nó; utilizar a restrição na via', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # node[noname?] + # node[noname?][inside("BR")] if (u'noname' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'noname') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'noname') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("uso suspeito de {0} em nó","{0.key}") - err.append({'class': 9018002, 'subclass': 1281771763, 'text': mapcss.tr(u'uso suspeito de {0} em nó', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 1940682714, 'text': mapcss.tr(u'uso suspeito de {0} em nó', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[designation] + # *[designation][inside("BR")] if (u'designation' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} é uma chave utilizada apenas no Reino Unido","{0.key}") # suggestAlternative:"description" # suggestAlternative:"name" - err.append({'class': 9018009, 'subclass': 1259259930, 'text': mapcss.tr(u'{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018009, 'subclass': 1818234763, 'text': mapcss.tr(u'{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # node[highway=motorway_junction][!name][!ref] + # node[highway=motorway_junction][!name][!ref][inside("BR")] if (u'highway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and not mapcss._tag_capture(capture_tags, 2, tags, u'ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and not mapcss._tag_capture(capture_tags, 2, tags, u'ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} sem pelo menos uma das tags: {1} ou {2}","{0.value}","{1.key}","{2.key}") - err.append({'class': 9018010, 'subclass': 1402053593, 'text': mapcss.tr(u'{0} sem pelo menos uma das tags: {1} ou {2}', mapcss._tag_uncapture(capture_tags, u'{0.value}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018010, 'subclass': 1629006877, 'text': mapcss.tr(u'{0} sem pelo menos uma das tags: {1} ou {2}', mapcss._tag_uncapture(capture_tags, u'{0.value}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000] + # *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_152c10ee), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 100000)) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_152c10ee), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 100000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com 100.000 habitantes ou mais deve ser classificado como city") # fixAdd:"place=city" - err.append({'class': 9018006, 'subclass': 149235075, 'text': mapcss.tr(u'local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1009134521, 'text': mapcss.tr(u'local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'city']]) }}) - # *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000] + # *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_591572a5), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 10000) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 100000)) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_591572a5), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 10000) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 100000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com população entre 10.000 e 100.000 deve ser classificado como town") # fixAdd:"place=town" - err.append({'class': 9018006, 'subclass': 1174321645, 'text': mapcss.tr(u'local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1343568198, 'text': mapcss.tr(u'local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'town']]) }}) - # *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000] + # *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3aeda39d), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 10000)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3aeda39d), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 10000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com menos de 10.000 habitantes deve ser classificado como village") # fixAdd:"place=village" - err.append({'class': 9018006, 'subclass': 719699918, 'text': mapcss.tr(u'local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 409005616, 'text': mapcss.tr(u'local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'village']]) }}) - # *[place=city][!population] - # *[place=town][!population] - # *[place=village][!population] + # *[place=city][!population][inside("BR")] + # *[place=town][!population][inside("BR")] + # *[place=village][!population][inside("BR")] # Rule Blacklisted - # *[place=city][!name] - # *[place=town][!name] - # *[place=village][!name] + # *[place=city][!name][inside("BR")] + # *[place=town][!name][inside("BR")] + # *[place=village][!name][inside("BR")] if (u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'city') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'city') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'town') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'town') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'village') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'village') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} sem nome","{0.value}") - err.append({'class': 9018012, 'subclass': 828568305, 'text': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018012, 'subclass': 1473808194, 'text': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # node[place=~/village|town|city/]["addr:city"=*name] - # node[place=suburb]["addr:suburb"=*name] + # node[place=~/village|town|city/]["addr:city"=*name][inside("BR")] + # node[place=suburb]["addr:suburb"=*name][inside("BR")] if (u'addr:city' in keys and u'place' in keys) or (u'addr:suburb' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0db5b64e), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'addr:city') == mapcss._value_capture(capture_tags, 1, mapcss.tag(tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0db5b64e), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'addr:city') == mapcss._value_capture(capture_tags, 1, mapcss.tag(tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'suburb') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:suburb') == mapcss._value_capture(capture_tags, 1, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'suburb') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:suburb') == mapcss._value_capture(capture_tags, 1, mapcss.tag(tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwError:tr("não deve possuir {0}","{1.key}") # fixRemove:"{1.key}" - err.append({'class': 9018006, 'subclass': 1782871982, 'text': mapcss.tr(u'não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 992485850, 'text': mapcss.tr(u'não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}')), 'allow_fix_override': True, 'fix': { '-': ([ mapcss._tag_uncapture(capture_tags, u'{1.key}')]) }}) - # *["addr:city"=~/(,|( |-) ?[A-Z]{2})/] + # *["addr:city"=~/(,|( |-) ?[A-Z]{2})/][inside("BR")] if (u'addr:city' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_10f1c360), mapcss._tag_capture(capture_tags, 0, tags, u'addr:city'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_10f1c360), mapcss._tag_capture(capture_tags, 0, tags, u'addr:city')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve conter apenas o nome da cidade","{0.key}") - err.append({'class': 9018013, 'subclass': 223700239, 'text': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018013, 'subclass': 1479274467, 'text': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/] + # *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2cd1e949), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5d3348cb), mapcss._tag_capture(capture_tags, 2, tags, u'place'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2cd1e949), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5d3348cb), mapcss._tag_capture(capture_tags, 2, tags, u'place')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto talvez deva ser {0}=farm","{1.key}") - err.append({'class': 9018002, 'subclass': 414255329, 'text': mapcss.tr(u'objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 337742963, 'text': mapcss.tr(u'objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/] + # *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_64387998), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_64387998), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto talvez não deva ter ''Bairro'' no nome") - err.append({'class': 9018002, 'subclass': 457937105, 'text': mapcss.tr(u'objeto talvez não deva ter \'\'Bairro\'\' no nome')}) + err.append({'class': 9018002, 'subclass': 1441242115, 'text': mapcss.tr(u'objeto talvez não deva ter \'\'Bairro\'\' no nome')}) - # node[place=~/^(island|islet)$/] + # node[place=~/^(island|islet)$/][inside("BR")] if (u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6416be64), mapcss._tag_capture(capture_tags, 0, tags, u'place'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6416be64), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("representar a ilha, se possível, como uma área") - err.append({'class': 9018002, 'subclass': 903906160, 'text': mapcss.tr(u'representar a ilha, se possível, como uma área')}) + err.append({'class': 9018002, 'subclass': 820669758, 'text': mapcss.tr(u'representar a ilha, se possível, como uma área')}) - # *[iata="0"] + # *[iata="0"][inside("BR")] if (u'iata' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'iata') == mapcss._value_capture(capture_tags, 0, u'0')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'iata') == mapcss._value_capture(capture_tags, 0, u'0') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com valor = {1}","{0.key}","{0.value}") - err.append({'class': 9018014, 'subclass': 1389202412, 'text': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018014, 'subclass': 1098244333, 'text': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/] + # *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_362f879f), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_362f879f), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("estabelecimento de ensino classificado incorretamente") # suggestAlternative:"amenity=university" # fixAdd:"{0.key}=university" - err.append({'class': 9018006, 'subclass': 221523813, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1605707172, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=university')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)/] - # *[amenity=~/school|university/][name=~/(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b/] + # *[amenity=school][name=~/^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)/][inside("BR")] + # *[amenity=~/school|university/][name=~/(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6c0d6e9e), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6c0d6e9e), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("estabelecimento de ensino classificado incorretamente") # suggestAlternative:"amenity=college" # fixAdd:"{0.key}=college" - err.append({'class': 9018006, 'subclass': 897019825, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1282773099, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=college')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/] + # *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("autoescola classificada incorretamente") # suggestAlternative:"amenity=driving_school" # fixAdd:"{0.key}=driving_school" - err.append({'class': 9018006, 'subclass': 1796023580, 'text': mapcss.tr(u'autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 566309924, 'text': mapcss.tr(u'autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=driving_school')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)creche\b/] + # *[amenity=school][name=~/^(?i)creche\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("creche classificada incorretamente") # suggestAlternative:"amenity=kindergarten" # fixAdd:"{0.key}=kindergarten" - err.append({'class': 9018006, 'subclass': 121701344, 'text': mapcss.tr(u'creche classificada incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1847987722, 'text': mapcss.tr(u'creche classificada incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=kindergarten')).split('=', 1)]) }}) - # *[name=~/^(?i)(?u)Subestação .*/][power][power!=substation] - # *[name=~/^(?i)(?u)Fórum .*/][amenity][amenity!=courthouse] - # *[name=~/^(?i)Hospital .*/][building][building!=hospital] - # *[name=~/^(?i)Universidade .*/][building][building!=university] - # *[name=~/^(?i)Escola .*/][building][building!=school] - # *[name=~/^(?i)Hotel .*/][building][building!=hotel] - # *[name=~/^(?i)Capela .*/][building][building!=chapel] - # *[name=~/^(?i)Igreja .*/][building][building!=church] - # *[name=~/^(?i)Catedral .*/][building][building!=cathedral] - # *[name=~/^(?i)Fazenda .*/][building][building!=farm] - # *[name=~/^(?i)Supermercado .*/][building][building!=supermarket] + # *[name=~/^(?i)(?u)Subestação .*/][power][power!=substation][inside("BR")] + # *[name=~/^(?i)(?u)Fórum .*/][amenity][amenity!=courthouse][inside("BR")] + # *[name=~/^(?i)Hospital .*/][building][building!=hospital][inside("BR")] + # *[name=~/^(?i)Universidade .*/][building][building!=university][inside("BR")] + # *[name=~/^(?i)Escola .*/][building][building!=school][inside("BR")] + # *[name=~/^(?i)Hotel .*/][building][building!=hotel][inside("BR")] + # *[name=~/^(?i)Capela .*/][building][building!=chapel][inside("BR")] + # *[name=~/^(?i)Igreja .*/][building][building!=church][inside("BR")] + # *[name=~/^(?i)Catedral .*/][building][building!=cathedral][inside("BR")] + # *[name=~/^(?i)Fazenda .*/][building][building!=farm][inside("BR")] + # *[name=~/^(?i)Supermercado .*/][building][building!=supermarket][inside("BR")] # Rule Blacklisted - # *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital] + # *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7b7c453d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') == mapcss._value_capture(capture_tags, 1, u'hospital')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7b7c453d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') == mapcss._value_capture(capture_tags, 1, u'hospital') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: + # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("postos/unidades de saúde devem ser amenity=clinic") - err.append({'class': 9018015, 'subclass': 2108543140, 'text': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic')}) + # fixAdd:"amenity=clinic" + err.append({'class': 9018006, 'subclass': 74419437, 'text': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'amenity',u'clinic']]) + }}) - # *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/] + # *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2dbaea13), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, u'amenity'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2dbaea13), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, u'amenity')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("SAMU classificado de forma errada") # suggestAlternative:"emergency=ambulance_station" - err.append({'class': 9018016, 'subclass': 2090365947, 'text': mapcss.tr(u'SAMU classificado de forma errada')}) + err.append({'class': 9018016, 'subclass': 392029310, 'text': mapcss.tr(u'SAMU classificado de forma errada')}) - # node[highway=~/^(give_way|mini_roundabout|stop|turning_circle)$/][name] + # node[highway=~/^(give_way|mini_roundabout|stop|turning_circle)$/][name][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_53abc074), mapcss._tag_capture(capture_tags, 0, tags, u'highway')) and mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_53abc074), mapcss._tag_capture(capture_tags, 0, tags, u'highway')) and mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto não deve possuir {0}","{1.key}") - err.append({'class': 9018017, 'subclass': 306235762, 'text': mapcss.tr(u'objeto não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018017, 'subclass': 1025728334, 'text': mapcss.tr(u'objeto não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # node[highway=speed_camera][!maxspeed] + # node[highway=speed_camera][!maxspeed][inside("BR")] if (u'highway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'speed_camera') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'speed_camera') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("adicionar {0} ao {1}","{1.key}","{0.tag}") - err.append({'class': 9018018, 'subclass': 1369285067, 'text': mapcss.tr(u'adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018018, 'subclass': 1228671542, 'text': mapcss.tr(u'adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[crossing][!highway][!railway] + # *[crossing][!highway][!railway][inside("BR")] if (u'crossing' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'crossing') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'crossing') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser utilizado com {1}={0} ou {2}={0}","{0.key}","{1.key}","{2.key}") - err.append({'class': 9018019, 'subclass': 139983185, 'text': mapcss.tr(u'{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018019, 'subclass': 2098306424, 'text': mapcss.tr(u'{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[aeroway][designation=~/^[A-Z]{4}$/][!icao] - # *[aeroway][ref=~/^[A-Z]{4}$/][!icao] + # *[aeroway][designation=~/^[A-Z]{4}$/][!icao][inside("BR")] + # *[aeroway][ref=~/^[A-Z]{4}$/][!icao][inside("BR")] if (u'aeroway' in keys and u'designation' in keys) or (u'aeroway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'designation')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'designation')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'ref')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'ref')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} provavelmente deve ser utilizado como {1}","{1.key}","{2.key}") # fixChangeKey:"{1.key} => {2.key}" - err.append({'class': 9018006, 'subclass': 662001655, 'text': mapcss.tr(u'{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 619372172, 'text': mapcss.tr(u'{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [(mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[1].strip(), mapcss.tag(tags, (mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[0].strip())]]), '-': ([ (mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[0].strip()]) }}) - # *[access=permissive] + # *[access=permissive][inside("BR")] if (u'access' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'access') == mapcss._value_capture(capture_tags, 0, u'permissive')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'access') == mapcss._value_capture(capture_tags, 0, u'permissive') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público","{0.tag}") - err.append({'class': 9018002, 'subclass': 1918455197, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 1240816112, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[name=~/^(?U)(\p{Upper}| )+$/] - # *["addr:street"=~/^(?U)(\p{Upper}| )+$/] + # *[name=~/^(?U)(\p{Upper}| )+$/][inside("BR")] + # *["addr:street"=~/^(?U)(\p{Upper}| )+$/][inside("BR")] # Rule Blacklisted - # *["addr:postcode"=~/^[0-9]{8}$/] + # *["addr:postcode"=~/^[0-9]{8}$/][inside("BR")] # Rule Blacklisted - # *[postal_code=~/^[0-9]{8}$/] + # *[postal_code=~/^[0-9]{8}$/][inside("BR")] # Rule Blacklisted - # *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/] + # *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")] if (u'addr:postcode' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'addr:postcode'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'addr:postcode')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("formato do CEP pode ser melhorado") # fixAdd:concat("addr:postcode=",replace(replace(tag("addr:postcode")," ","-"),".","-")) - err.append({'class': 9018006, 'subclass': 308348773, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1667206075, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'addr:postcode=', mapcss.replace(mapcss.replace(mapcss.tag(tags, u'addr:postcode'), u' ', u'-'), u'.', u'-'))).split('=', 1)]) }}) - # *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/] + # *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")] if (u'postal_code' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'postal_code'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'postal_code')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("formato do CEP pode ser melhorado") # fixAdd:concat("postal_code=",replace(replace(tag("postal_code")," ","-"),".","-")) - err.append({'class': 9018006, 'subclass': 1211220107, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1977906896, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'postal_code=', mapcss.replace(mapcss.replace(mapcss.tag(tags, u'postal_code'), u' ', u'-'), u'.', u'-'))).split('=', 1)]) }}) - # *["addr:postcode"]["addr:postcode"!~/^[0-9]{5}-[0-9]{3}$/] - # *[postal_code][postal_code!~/^[0-9]{5}-[0-9]{3}$/] + # *["addr:postcode"]["addr:postcode"!~/^[0-9]{5}-[0-9]{3}$/][inside("BR")] + # *[postal_code][postal_code!~/^[0-9]{5}-[0-9]{3}$/][inside("BR")] # Rule Blacklisted - # *[alt_source][source] + # *[alt_source][source][inside("BR")] if (u'alt_source' in keys and u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_source') and mapcss._tag_capture(capture_tags, 1, tags, u'source')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_source') and mapcss._tag_capture(capture_tags, 1, tags, u'source') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve estar incluído em {1}, separado por '';'' caso necessário","{0.key}","{1.key}") - err.append({'class': 9018020, 'subclass': 512568644, 'text': mapcss.tr(u'{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018020, 'subclass': 472956812, 'text': mapcss.tr(u'{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[landuse?] + # *[landuse?][inside("BR")] if (u'landuse' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("especificar valor correto para {0} ao invés de ''{1}''","{0.key}",tag("landuse")) - err.append({'class': 9018021, 'subclass': 2004192493, 'text': mapcss.tr(u'especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'landuse'))}) + err.append({'class': 9018021, 'subclass': 6418462, 'text': mapcss.tr(u'especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'landuse'))}) - # *[long_name] + # *[long_name][inside("BR")] if (u'long_name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'long_name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'long_name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("chave inválida: {0}","{0.key}") # suggestAlternative:"alt_name" # suggestAlternative:"name" # suggestAlternative:"official_name" - err.append({'class': 9018022, 'subclass': 1648910015, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018022, 'subclass': 1737555221, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["building:levels"<1] + # *["building:levels"<1][inside("BR")] if (u'building:levels' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:levels') < mapcss._value_capture(capture_tags, 0, 1)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:levels') < mapcss._value_capture(capture_tags, 0, 1) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com valor inválido","{0.key}") - err.append({'class': 9018002, 'subclass': 154478605, 'text': mapcss.tr(u'{0} com valor inválido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 775859422, 'text': mapcss.tr(u'{0} com valor inválido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[hires?] + # *[hires?][inside("BR")] if (u'hires' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'hires') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'hires') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não se deve utilizar {0} para demarcar áreas de cobertura de imagem","{0.key}") - err.append({'class': 9018023, 'subclass': 1394305840, 'text': mapcss.tr(u'não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018023, 'subclass': 895278192, 'text': mapcss.tr(u'não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[tourism=motel][amenity!=love_hotel] - # *[name=~/(?i)\bmotel\b/][amenity!=love_hotel] + # *[tourism=motel][amenity!=love_hotel][inside("BR")] + # *[name=~/(?i)\bmotel\b/][amenity!=love_hotel][inside("BR")] if (u'name' in keys) or (u'tourism' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'motel') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'motel') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_01454d46), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_01454d46), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("ausência de tag ''{0}''","{1.value}") # fixAdd:"{1.key}={1.value}" - err.append({'class': 9018006, 'subclass': 444111908, 'text': mapcss.tr(u'ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{1.value}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1987370859, 'text': mapcss.tr(u'ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{1.value}')), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{1.key}={1.value}')).split('=', 1)]) }}) - # *[amenity=love_hotel][tourism][tourism!=motel] + # *[amenity=love_hotel][tourism][tourism!=motel][inside("BR")] if (u'amenity' in keys and u'tourism' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'love_hotel') and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') and mapcss._tag_capture(capture_tags, 2, tags, u'tourism') != mapcss._value_capture(capture_tags, 2, u'motel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'love_hotel') and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') and mapcss._tag_capture(capture_tags, 2, tags, u'tourism') != mapcss._value_capture(capture_tags, 2, u'motel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("provavelmente deve ser ''{0}={1}''","{2.key}","{2.value}") - err.append({'class': 9018002, 'subclass': 2021262051, 'text': mapcss.tr(u'provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'))}) + err.append({'class': 9018002, 'subclass': 1760828878, 'text': mapcss.tr(u'provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'))}) - # *[name=~/(?i)^motel\b/][tourism!=motel] + # *[name=~/(?i)^motel\b/][tourism!=motel][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5cd37790), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') != mapcss._value_capture(capture_tags, 1, u'motel')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5cd37790), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') != mapcss._value_capture(capture_tags, 1, u'motel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("motel classificado incorretamente") # suggestAlternative:"tourism=motel" - err.append({'class': 9018002, 'subclass': 2096064741, 'text': mapcss.tr(u'motel classificado incorretamente')}) + err.append({'class': 9018002, 'subclass': 1456128106, 'text': mapcss.tr(u'motel classificado incorretamente')}) - # *[aeroway=aerodrome][name=~/(?i).*airport$/] - # *[aeroway=helipad][name=~/(?i).*heliport$/] + # *[aeroway=aerodrome][name=~/(?i).*airport$/][inside("BR")] + # *[aeroway=helipad][name=~/(?i).*heliport$/][inside("BR")] if (u'aeroway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com nome em inglês","{0.tag}") - err.append({'class': 9018002, 'subclass': 134725283, 'text': mapcss.tr(u'{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 1743601177, 'text': mapcss.tr(u'{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/] - # *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/] + # *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/][inside("BR")] + # *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/][inside("BR")] if (u'aeroway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("conferir se existe nome oficial do {0}","{0.value}") - err.append({'class': 9018002, 'subclass': 2002284471, 'text': mapcss.tr(u'conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 136467214, 'text': mapcss.tr(u'conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[aeroway=aerodrome][ref] + # *[aeroway=aerodrome][ref][inside("BR")] if (u'aeroway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss._tag_capture(capture_tags, 1, tags, u'ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss._tag_capture(capture_tags, 1, tags, u'ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("''{0}'' não faz sentido em aeroporto","{1.key}") - err.append({'class': 9018002, 'subclass': 339634841, 'text': mapcss.tr(u'\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 1633437696, 'text': mapcss.tr(u'\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # node[surface][!traffic_calming] + # node[surface][!traffic_calming][inside("BR")] # Rule Blacklisted - # *[waterway][layer<0][!tunnel] + # *[waterway][layer<0][!tunnel][inside("BR")] if (u'layer' in keys and u'waterway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') < mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'tunnel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') < mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'tunnel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} negativo de {1} com ausência de {2}","{1.key}","{0.key}","{2.key}") - err.append({'class': 9018002, 'subclass': 1476002587, 'text': mapcss.tr(u'{0} negativo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018002, 'subclass': 203420779, 'text': mapcss.tr(u'{0} negativo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[waterway][layer>0][!bridge] + # *[waterway][layer>0][!bridge][inside("BR")] if (u'layer' in keys and u'waterway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') > mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') > mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} positivo de {1} com ausência de {2}","{1.key}","{0.key}","{2.key}") - err.append({'class': 9018002, 'subclass': 1137415389, 'text': mapcss.tr(u'{0} positivo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018002, 'subclass': 1870051659, 'text': mapcss.tr(u'{0} positivo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[layer][!building][!highway][man_made!=pipeline][!railway][!waterway] + # *[layer][!building][!highway][man_made!=pipeline][!railway][!waterway][power!=line][inside("BR")] # Rule Blacklisted - # *[name=~/^(?i)(?u)edifício.*/][!building] + # *[name=~/^(?i)(?u)edifício.*/][!building][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_38a8f0ff), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'building')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_38a8f0ff), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'building') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("possível ausência de tag {0}","{1.key}") - err.append({'class': 9018026, 'subclass': 1417041710, 'text': mapcss.tr(u'possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018026, 'subclass': 1332986859, 'text': mapcss.tr(u'possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[route=ferry][!duration] + # *[route=ferry][!duration][inside("BR")] if (u'route' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'ferry') and not mapcss._tag_capture(capture_tags, 1, tags, u'duration')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'ferry') and not mapcss._tag_capture(capture_tags, 1, tags, u'duration') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("ausência do tempo de duração ({0}) da balsa","{1.key}") - err.append({'class': 9018027, 'subclass': 1289884816, 'text': mapcss.tr(u'ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018027, 'subclass': 1343391603, 'text': mapcss.tr(u'ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[name=~/^(?i)(?u)praça.*/][!leisure][landuse=~/^(forest|grass|greenfield|meadow|orchard)$/] - # *[name=~/^(?i)(?u)praça.*/][!leisure][natural=~/^(grassland|heath|scrub|wood)$/] + # *[name=~/^(?i)(?u)praça.*/][!leisure][landuse=~/^(forest|grass|greenfield|meadow|orchard)$/][inside("BR")] + # *[name=~/^(?i)(?u)praça.*/][!leisure][natural=~/^(grassland|heath|scrub|wood)$/][inside("BR")] if (u'landuse' in keys and u'name' in keys) or (u'name' in keys and u'natural' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_05a345c7), mapcss._tag_capture(capture_tags, 2, tags, u'landuse'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_05a345c7), mapcss._tag_capture(capture_tags, 2, tags, u'landuse')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_12b48afb), mapcss._tag_capture(capture_tags, 2, tags, u'natural'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_12b48afb), mapcss._tag_capture(capture_tags, 2, tags, u'natural')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("possível definição incorreta para praça: ''{0}''","{2.key}") # suggestAlternative:"leisure=park" - err.append({'class': 9018029, 'subclass': 80498829, 'text': mapcss.tr(u'possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018029, 'subclass': 181066872, 'text': mapcss.tr(u'possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[wikipedia][wikipedia!~/^pt:/] + # *[wikipedia][wikipedia!~/^pt:/][inside("BR")] if (u'wikipedia' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_17fd35b3), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_17fd35b3), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("utilizar prefixo em português (pt:) para {0}","{0.key}") - err.append({'class': 9018030, 'subclass': 1219382195, 'text': mapcss.tr(u'utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018030, 'subclass': 1431112366, 'text': mapcss.tr(u'utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/.*\(.*\).*/] + # *[name=~/.*\(.*\).*/][inside("BR")] # Rule Blacklisted - # *[name=~/ - /] + # *[name=~/ - /][inside("BR")] # Rule Blacklisted - # *[name=~/, /] + # *[name=~/, /][inside("BR")] # Rule Blacklisted - # *[name=~/: /] + # *[name=~/: /][inside("BR")] # Rule Blacklisted - # *[name=~/ ou /] + # *[name=~/ ou /][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_131cc885), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_131cc885), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome utilizado de forma incorreta") # suggestAlternative:"name e alt_name" - err.append({'class': 9018031, 'subclass': 23034604, 'text': mapcss.tr(u'nome utilizado de forma incorreta')}) + err.append({'class': 9018031, 'subclass': 115703372, 'text': mapcss.tr(u'nome utilizado de forma incorreta')}) - # node[admin_level][!capital] - # node[border_type] - # node[boundary] - # node[type=boundary] + # node[admin_level][!capital][inside("BR")] + # node[border_type][inside("BR")] + # node[boundary][inside("BR")] + # node[type=boundary][inside("BR")] if (u'admin_level' in keys) or (u'border_type' in keys) or (u'boundary' in keys) or (u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'admin_level') and not mapcss._tag_capture(capture_tags, 1, tags, u'capital')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'admin_level') and not mapcss._tag_capture(capture_tags, 1, tags, u'capital') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'border_type')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'border_type') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'boundary')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'boundary') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("nó não deve possuir {0}","{0.tag}") - err.append({'class': 9018032, 'subclass': 573228766, 'text': mapcss.tr(u'nó não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018032, 'subclass': 90903508, 'text': mapcss.tr(u'nó não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[boundary=national_park][!name] - # *[boundary=protected_area][!name] - # *[leisure=nature_reserve][!name] + # *[boundary=national_park][!name][inside("BR")] + # *[boundary=protected_area][!name][inside("BR")] + # *[leisure=nature_reserve][!name][inside("BR")] if (u'boundary' in keys) or (u'leisure' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'national_park') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'national_park') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 1492609299, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 1196875584, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[boundary=protected_area][!protect_class] + # *[boundary=protected_area][!protect_class][inside("BR")] if (u'boundary' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'protect_class')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'protect_class') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 822952800, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 1593244126, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[protect_class][protect_class!~/^(1(a|b)?|[1-9][0-9]?)$/] + # *[protect_class][protect_class!~/^(1(a|b)?|[1-9][0-9]?)$/][inside("BR")] if (u'protect_class' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5ac7053e), mapcss._tag_capture(capture_tags, 1, tags, u'protect_class'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5ac7053e), mapcss._tag_capture(capture_tags, 1, tags, u'protect_class')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("valor incorreto para {0}","{0.key}") - err.append({'class': 9018034, 'subclass': 1459161459, 'text': mapcss.tr(u'valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018034, 'subclass': 1183781531, 'text': mapcss.tr(u'valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[protect_class][boundary!=protected_area] + # *[protect_class][boundary!=protected_area][inside("BR")] if (u'protect_class' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'protected_area')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'protected_area') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("ausência de boundary=protected_area") - err.append({'class': 9018035, 'subclass': 1208814760, 'text': mapcss.tr(u'ausência de boundary=protected_area')}) + err.append({'class': 9018035, 'subclass': 1649283274, 'text': mapcss.tr(u'ausência de boundary=protected_area')}) - # node[destination] + # node[destination][inside("BR")] if (u'destination' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'destination')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'destination') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser usado apenas em ways","{0.key}") - err.append({'class': 9018036, 'subclass': 1394019686, 'text': mapcss.tr(u'{0} deve ser usado apenas em ways', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018036, 'subclass': 878235238, 'text': mapcss.tr(u'{0} deve ser usado apenas em ways', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # node[exit_to] + # node[exit_to][inside("BR")] if (u'exit_to' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'exit_to')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'exit_to') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("utilize ''destination'' no caminho de saída ao invés de ''exit_to''") - err.append({'class': 9018037, 'subclass': 2117439762, 'text': mapcss.tr(u'utilize \'\'destination\'\' no caminho de saída ao invés de \'\'exit_to\'\'')}) + err.append({'class': 9018037, 'subclass': 1738747667, 'text': mapcss.tr(u'utilize \'\'destination\'\' no caminho de saída ao invés de \'\'exit_to\'\'')}) - # node[highway=motorway_junction][ref][ref!~/^[0-9]+( |-)*([A-Z])?$/] + # node[highway=motorway_junction][ref][ref!~/^[0-9]+( |-)*([A-Z])?$/][inside("BR")] if (u'highway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and mapcss._tag_capture(capture_tags, 1, tags, u'ref') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_20188fb1), mapcss._tag_capture(capture_tags, 2, tags, u'ref'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and mapcss._tag_capture(capture_tags, 1, tags, u'ref') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_20188fb1), mapcss._tag_capture(capture_tags, 2, tags, u'ref')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("saída de rodovia ({0}) fora do padrão","{1.key}") - err.append({'class': 9018002, 'subclass': 2069822365, 'text': mapcss.tr(u'saída de rodovia ({0}) fora do padrão', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 1001734093, 'text': mapcss.tr(u'saída de rodovia ({0}) fora do padrão', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # node[highway=motorway_junction][name] + # node[highway=motorway_junction][name][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} geralmente não possui nome; use ''destination'' no caminho de saída","{0.tag}") - err.append({'class': 9018002, 'subclass': 1930778720, 'text': mapcss.tr(u'{0} geralmente não possui nome; use \'\'destination\'\' no caminho de saída', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 625356625, 'text': mapcss.tr(u'{0} geralmente não possui nome; use \'\'destination\'\' no caminho de saída', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # node[junction] + # node[junction][inside("BR")] if (u'junction' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'junction')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'junction') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("junção ({0}) em um nó","{0.value}") # suggestAlternative:"highway=mini_roundabout" # suggestAlternative:"highway=turning_circle" - err.append({'class': 9018002, 'subclass': 1193804268, 'text': mapcss.tr(u'junção ({0}) em um nó', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 1621901547, 'text': mapcss.tr(u'junção ({0}) em um nó', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[name=~/.* D(a|e|o)s? .*/] + # *[name=~/.* D(a|e|o)s? .*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2ffc377d), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2ffc377d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("''da'', ''de'' e ''do'' são minúsculos nos nomes em português") - err.append({'class': 9018002, 'subclass': 1986668346, 'text': mapcss.tr(u'\'\'da\'\', \'\'de\'\' e \'\'do\'\' são minúsculos nos nomes em português')}) + err.append({'class': 9018002, 'subclass': 874509528, 'text': mapcss.tr(u'\'\'da\'\', \'\'de\'\' e \'\'do\'\' são minúsculos nos nomes em português')}) - # *[name=~/^[a-z].*/] + # *[name=~/^[a-z].*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_39d67968), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_39d67968), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("nome iniciando com letra minúscula") - err.append({'class': 9018002, 'subclass': 167462302, 'text': mapcss.tr(u'nome iniciando com letra minúscula')}) + err.append({'class': 9018002, 'subclass': 2073274467, 'text': mapcss.tr(u'nome iniciando com letra minúscula')}) - # *[alt_ref] + # *[alt_ref][inside("BR")] if (u'alt_ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("o conteúdo de {0} deve fazer parte de ref, separado por ;","{0.key}") # suggestAlternative:"ref" - err.append({'class': 9018039, 'subclass': 722411109, 'text': mapcss.tr(u'o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018039, 'subclass': 836388143, 'text': mapcss.tr(u'o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[surface][eval(number_of_tags())=1] + # *[surface][eval(number_of_tags())=1][inside("BR")] if (u'surface' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'surface') and len(tags) == 1) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'surface') and len(tags) == 1 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto incompleto: possui apenas {0}","{0.key}") - err.append({'class': 9018041, 'subclass': 1776991136, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018041, 'subclass': 411244066, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name][surface][eval(number_of_tags())=2] - # *[name][website][eval(number_of_tags())=2] + # *[name][surface][eval(number_of_tags())=2][inside("BR")] + # *[name][website][eval(number_of_tags())=2][inside("BR")] if (u'name' in keys and u'surface' in keys) or (u'name' in keys and u'website' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and len(tags) == 2) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and len(tags) == 2 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'website') and len(tags) == 2) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'website') and len(tags) == 2 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto incompleto: possui apenas {0} e {1}","{0.key}","{1.key}") - err.append({'class': 9018042, 'subclass': 626126700, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018042, 'subclass': 585137381, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + + # node[natural=peak][name=~/(?i)\b[0-9]+ ?m?\b/][inside("BR")] + if (u'name' in keys and u'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'natural') == mapcss._value_capture(capture_tags, 0, u'peak') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_292e0bb5), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("nome não deve conter a elevação do pico") + # suggestAlternative:"ele" + err.append({'class': 9018002, 'subclass': 907675189, 'text': mapcss.tr(u'nome não deve conter a elevação do pico')}) - # *[leisure=pitch][sport=tennis][surface=unpaved] + # *[leisure=pitch][sport=tennis][surface=unpaved][inside("BR")] if (u'leisure' in keys and u'sport' in keys and u'surface' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'pitch') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') == mapcss._value_capture(capture_tags, 1, u'tennis') and mapcss._tag_capture(capture_tags, 2, tags, u'surface') == mapcss._value_capture(capture_tags, 2, u'unpaved')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'pitch') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') == mapcss._value_capture(capture_tags, 1, u'tennis') and mapcss._tag_capture(capture_tags, 2, tags, u'surface') == mapcss._value_capture(capture_tags, 2, u'unpaved') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} com superfície incorreta","{2.key}") # suggestAlternative:"surface=clay" # fixAdd:"surface=clay" - err.append({'class': 9018006, 'subclass': 1659179489, 'text': mapcss.tr(u'{0} com superfície incorreta', mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 990400213, 'text': mapcss.tr(u'{0} com superfície incorreta', mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'surface',u'clay']]) }}) - # *[amenity=fuel][name=~/(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b/] + # *[amenity=fuel][name=~/(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_604bb645), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_604bb645), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("o nome não deve conter a bandeira/marca do posto") + # suggestAlternative:"brand" + err.append({'class': 9018002, 'subclass': 1724035987, 'text': mapcss.tr(u'o nome não deve conter a bandeira/marca do posto')}) + + # *[amenity=fuel][brand=BR][inside("BR")] + if (u'amenity' in keys and u'brand' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss._tag_capture(capture_tags, 1, tags, u'brand') == mapcss._value_capture(capture_tags, 1, u'BR') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("uso inconsistente de bandeira do posto") + # suggestAlternative:"brand=Petrobras" + # fixAdd:"brand=Petrobras" + err.append({'class': 9018002, 'subclass': 435141543, 'text': mapcss.tr(u'uso inconsistente de bandeira do posto'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'brand',u'Petrobras']]) + }}) + + # *[shop=gas][name=~/(?i)(?u)^(Brasilg(á|a)s|Consigaz|Copagaz|Liquig(á|a)s|Minasg(á|a)s|Nacional G(á|a)s|Supergasbras|Ultragaz)$/][inside("BR")] + if (u'name' in keys and u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'gas') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_31732cd0), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") - # throwWarning:tr("uso incorreto da bandeira do posto") + # throwWarning:tr("o nome não deve conter a bandeira/marca da loja") # suggestAlternative:"brand" - err.append({'class': 9018002, 'subclass': 935774110, 'text': mapcss.tr(u'uso incorreto da bandeira do posto')}) + err.append({'class': 9018002, 'subclass': 867102166, 'text': mapcss.tr(u'o nome não deve conter a bandeira/marca da loja')}) - # *[/_[0-9]$/][!"is_in:iso_3166_2"] + # *[/_[0-9]$/][!"is_in:iso_3166_2"][inside("BR")] if True: match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_57b8ef8e) and not mapcss._tag_capture(capture_tags, 1, tags, u'is_in:iso_3166_2')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_57b8ef8e) and not mapcss._tag_capture(capture_tags, 1, tags, u'is_in:iso_3166_2') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("chave inválida: {0}","{0.key}") - err.append({'class': 9018022, 'subclass': 331369569, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018022, 'subclass': 231229079, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][!note] + # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][!note][inside("BR")] if (u'addr:housenumber' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and not mapcss._tag_capture(capture_tags, 1, tags, u'note')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and not mapcss._tag_capture(capture_tags, 1, tags, u'note') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") @@ -1294,115 +1353,266 @@ def node(self, data, tags): # suggestAlternative:"note" # fixRemove:"addr:housenumber" # fixAdd:"note=Local sem número" - err.append({'class': 9018006, 'subclass': 931902546, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 630415638, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'note',u'Local sem número']]), '-': ([ u'addr:housenumber']) }}) - # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][note] + # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][note][inside("BR")] if (u'addr:housenumber' in keys and u'note' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and mapcss._tag_capture(capture_tags, 1, tags, u'note')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and mapcss._tag_capture(capture_tags, 1, tags, u'note') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não utilizar ''{0}'' para locais sem número",tag("addr:housenumber")) # suggestAlternative:"note" - err.append({'class': 9018043, 'subclass': 1717284811, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber'))}) + err.append({'class': 9018043, 'subclass': 1150070765, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber'))}) - # *[source=~/(?i)google/] + # *[source=~/(?i)google/][inside("BR")] if (u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2e8e4f2b), mapcss._tag_capture(capture_tags, 0, tags, u'source'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2e8e4f2b), mapcss._tag_capture(capture_tags, 0, tags, u'source')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("objeto contém Google como source") - err.append({'class': 9018044, 'subclass': 1313403884, 'text': mapcss.tr(u'objeto contém Google como source')}) + err.append({'class': 9018044, 'subclass': 1159310436, 'text': mapcss.tr(u'objeto contém Google como source')}) - # *[amenity=townhall][name=~/^(?i)(?u)c(â|a)mara\b/] + # *[amenity=townhall][name=~/^(?i)(?u)c(â|a)mara\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("câmara de vereadores mapeada incorretamente") # suggestAlternative:"office=government + government=legislative" - err.append({'class': 9018002, 'subclass': 129695507, 'text': mapcss.tr(u'câmara de vereadores mapeada incorretamente')}) + err.append({'class': 9018002, 'subclass': 532372413, 'text': mapcss.tr(u'câmara de vereadores mapeada incorretamente')}) - # *[office=government][government!=legislative][name=~/^(?i)(?u)c(â|a)mara\b/] + # *[office=government][government!=legislative][name=~/^(?i)(?u)c(â|a)mara\b/][inside("BR")] if (u'name' in keys and u'office' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss._tag_capture(capture_tags, 1, tags, u'government') != mapcss._value_capture(capture_tags, 1, u'legislative') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss._tag_capture(capture_tags, 1, tags, u'government') != mapcss._value_capture(capture_tags, 1, u'legislative') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("ausência de government=legislative") - err.append({'class': 9018002, 'subclass': 869412796, 'text': mapcss.tr(u'ausência de government=legislative')}) + err.append({'class': 9018002, 'subclass': 2126685099, 'text': mapcss.tr(u'ausência de government=legislative')}) - # *[amenity=townhall][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/] - # *[office=government][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/] + # *[amenity=townhall][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/][inside("BR")] + # *[office=government][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys) or (u'name' in keys and u'office' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("erro de ortografia em ''câmara''") - err.append({'class': 9018002, 'subclass': 212328084, 'text': mapcss.tr(u'erro de ortografia em \'\'câmara\'\'')}) + err.append({'class': 9018002, 'subclass': 1277153079, 'text': mapcss.tr(u'erro de ortografia em \'\'câmara\'\'')}) - # *[amenity=charging_station] + # *[name=~/(?i)^prefeitura\b/][amenity!=townhall][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7ec1fb9a), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'townhall') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("prefeitura possivelmente mapeada de forma incorreta") + # suggestAlternative:"amenity=townhall" + err.append({'class': 9018002, 'subclass': 1445137044, 'text': mapcss.tr(u'prefeitura possivelmente mapeada de forma incorreta')}) + + # *[name=~/(?i)(?u)^paço\b/][amenity!=townhall][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_13f4c147), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'townhall') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("paço possivelmente mapeado de forma incorreta") + # suggestAlternative:"amenity=townhall" + err.append({'class': 9018002, 'subclass': 1169494638, 'text': mapcss.tr(u'paço possivelmente mapeado de forma incorreta')}) + + # *[amenity=charging_station][inside("BR")] if (u'amenity' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'charging_station')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'charging_station') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("possivelmente deve ser amenity=fuel") - err.append({'class': 9018002, 'subclass': 128902291, 'text': mapcss.tr(u'possivelmente deve ser amenity=fuel')}) + err.append({'class': 9018002, 'subclass': 2011797637, 'text': mapcss.tr(u'possivelmente deve ser amenity=fuel')}) - # *[name=~/(?i)^Borrach(aria|eiro)/][shop=tyres][!repair] + # *[name=~/(?i)^Borrach(aria|eiro)/][shop=tyres][!repair][inside("BR")] if (u'name' in keys and u'shop' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') == mapcss._value_capture(capture_tags, 1, u'tyres') and not mapcss._tag_capture(capture_tags, 2, tags, u'repair')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') == mapcss._value_capture(capture_tags, 1, u'tyres') and not mapcss._tag_capture(capture_tags, 2, tags, u'repair') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("borracharia sem ''repair=yes''") # suggestAlternative:"repair=yes" - err.append({'class': 9018002, 'subclass': 817061630, 'text': mapcss.tr(u'borracharia sem \'\'repair=yes\'\'')}) + err.append({'class': 9018002, 'subclass': 1225518759, 'text': mapcss.tr(u'borracharia sem \'\'repair=yes\'\'')}) - # *[name=~/(?i)^Borrach(aria|eiro)/][shop!=tyres] + # *[name=~/(?i)^Borrach(aria|eiro)/][shop!=tyres][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') != mapcss._value_capture(capture_tags, 1, u'tyres')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') != mapcss._value_capture(capture_tags, 1, u'tyres') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("borracharia sem ''shop=tyres''") # suggestAlternative:"shop=tyres" - err.append({'class': 9018002, 'subclass': 1324999258, 'text': mapcss.tr(u'borracharia sem \'\'shop=tyres\'\'')}) + err.append({'class': 9018002, 'subclass': 755877630, 'text': mapcss.tr(u'borracharia sem \'\'shop=tyres\'\'')}) + + # *[name=~/(?i)\bcoreto\b/][leisure!=bandstand][leisure!=park][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6e34cd0f), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'leisure') != mapcss._value_capture(capture_tags, 1, u'bandstand') and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') != mapcss._value_capture(capture_tags, 2, u'park') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("coreto possivelmente classificado de forma incorreta") + # suggestAlternative:"leisure=bandstand" + err.append({'class': 9018002, 'subclass': 810497942, 'text': mapcss.tr(u'coreto possivelmente classificado de forma incorreta')}) + + # *[leisure=recreation_ground][inside("BR")] + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'recreation_ground') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} impreciso","{0.tag}") + # suggestAlternative:"landuse=recreation_ground" + # suggestAlternative:"leisure=park" + err.append({'class': 9018002, 'subclass': 1594563801, 'text': mapcss.tr(u'{0} impreciso', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[leisure=recreation_ground][landuse=recreation_ground][inside("BR")] + if (u'landuse' in keys and u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'recreation_ground') and mapcss._tag_capture(capture_tags, 1, tags, u'landuse') == mapcss._value_capture(capture_tags, 1, u'recreation_ground') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} supérfluo","{0.tag}") + # fixRemove:"leisure" + err.append({'class': 9018002, 'subclass': 627419845, 'text': mapcss.tr(u'{0} supérfluo', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'leisure']) + }}) + + # *["ref:vatin"]["ref:vatin"!~/^BR[0-9]{14}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_524288b6), mapcss._tag_capture(capture_tags, 1, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("CNPJ diferente do formato BRxxxxxxxxxxxxxx") + err.append({'class': 9018002, 'subclass': 1793026117, 'text': mapcss.tr(u'CNPJ diferente do formato BRxxxxxxxxxxxxxx')}) + + # *["ref:vatin"=~/^[0-9]{2}\.[0-9]{3}\.[0-9]{3}\/[0-9]{4}-[0-9]{2}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ddbb7eb), mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Correções e melhorias") + # throwWarning:tr("formato do CNPJ pode ser melhorado em {0}","{0.key}") + # fixAdd:concat("ref:vatin=BR",replace(replace(replace(tag("ref:vatin"),"/",""),".",""),"-","")) + err.append({'class': 9018006, 'subclass': 1609978963, 'text': mapcss.tr(u'formato do CNPJ pode ser melhorado em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + (mapcss.concat(u'ref:vatin=BR', mapcss.replace(mapcss.replace(mapcss.replace(mapcss.tag(tags, u'ref:vatin'), u'/', u''), u'.', u''), u'-', u''))).split('=', 1)]) + }}) + + # *["ref:vatin"=~/^(br|bR|Br)[0-9]{14}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_408831d0), mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Correções e melhorias") + # throwWarning:tr("CNPJ deve iniciar maiúsculo: BRxxxxxxxxxxxxxx") + # fixAdd:concat("ref:vatin=",upper(tag("ref:vatin"))) + err.append({'class': 9018006, 'subclass': 1616044431, 'text': mapcss.tr(u'CNPJ deve iniciar maiúsculo: BRxxxxxxxxxxxxxx'), 'allow_fix_override': True, 'fix': { + '+': dict([ + (mapcss.concat(u'ref:vatin=', mapcss.upper(mapcss.tag(tags, u'ref:vatin')))).split('=', 1)]) + }}) + + # *[phone][phone!~/^(\+55|0800)/][inside("BR")] + # *["contact:phone"]["contact:phone"!~/^(\+55|0800)/][inside("BR")] + if (u'contact:phone' in keys) or (u'phone' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'phone') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_243f4993), mapcss._tag_capture(capture_tags, 1, tags, u'phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'contact:phone') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_243f4993), mapcss._tag_capture(capture_tags, 1, tags, u'contact:phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} em formato diferente do internacional +55 XX YYYY-YYYY","{0.key}") + err.append({'class': 9018002, 'subclass': 1438682200, 'text': mapcss.tr(u'{0} em formato diferente do internacional +55 XX YYYY-YYYY', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + + # *[phone=~/^(100|18{0,1}|19[0-9])$/][inside("BR")] + # *["contact:phone"=~/^(100|18{0,1}|19[0-9])$/][inside("BR")] + if (u'contact:phone' in keys) or (u'phone' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7a246e93), mapcss._tag_capture(capture_tags, 0, tags, u'phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7a246e93), mapcss._tag_capture(capture_tags, 0, tags, u'contact:phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("não usar número de emergência em {0}","{0.key}") + # fixRemove:"{0.key}" + err.append({'class': 9018002, 'subclass': 371146161, 'text': mapcss.tr(u'não usar número de emergência em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) return err @@ -1412,1130 +1622,1217 @@ def way(self, data, tags, nds): err = [] - # way[name=*ref][highway] + # way[name=*ref][highway][inside("BR")] # Rule Blacklisted - # way[highway][name=~/\b[A-Z]{2,4} (- )?[0-9]{2,3}\b/] + # way[highway][name=~/\b[A-Z]{2,4} (- )?[0-9]{2,3}\b/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_568a42f4), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_568a42f4), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("rodovia com ref no nome") - err.append({'class': 9018045, 'subclass': 63246253, 'text': mapcss.tr(u'rodovia com ref no nome')}) + err.append({'class': 9018045, 'subclass': 457207682, 'text': mapcss.tr(u'rodovia com ref no nome')}) - # way[highway=cycleway][name][name!~/^(?i)ciclovia .*/] - # way[highway][highway!~/bridleway|bus_stop|cycleway|crossing|footway|give_way|motorway_junction|path|raceway|rest_area|services|speed_camera|steps|stop/][name][name!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodoanel|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/] + # way[highway=cycleway][name][name!~/^(?i)ciclovia .*/][inside("BR")] + # way[highway][highway!~/bridleway|bus_stop|cycleway|crossing|footway|give_way|motorway_junction|path|raceway|rest_area|services|speed_camera|steps|stop/][name][name!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Calçadão|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodoanel|Rodovia|Rotatória|Rótula|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'cycleway') and mapcss._tag_capture(capture_tags, 1, tags, u'name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2fcb6bab), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'cycleway') and mapcss._tag_capture(capture_tags, 1, tags, u'name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2fcb6bab), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1054eb5a), mapcss._tag_capture(capture_tags, 1, tags, u'highway')) and mapcss._tag_capture(capture_tags, 2, tags, u'name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_57eb9fe5), mapcss._tag_capture(capture_tags, 3, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1054eb5a), mapcss._tag_capture(capture_tags, 1, tags, u'highway')) and mapcss._tag_capture(capture_tags, 2, tags, u'name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_60ad6838), mapcss._tag_capture(capture_tags, 3, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com logradouro ausente, errado ou abreviado","{0.key}") - err.append({'class': 9018001, 'subclass': 1231643071, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018001, 'subclass': 20071126, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["addr:street"]["addr:street"!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/] + # *["addr:street"]["addr:street"!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Calçadão|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/][inside("BR")] if (u'addr:street' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b777b9d), mapcss._tag_capture(capture_tags, 1, tags, u'addr:street'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6bf570a0), mapcss._tag_capture(capture_tags, 1, tags, u'addr:street')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com logradouro ausente, errado ou abreviado","{0.key}") - err.append({'class': 9018001, 'subclass': 588331445, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018001, 'subclass': 279840772, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[!highway][route!=road][!public_transport][type!~/route|street/][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*/][name!~/^(?i)estrada de ferro/] + # *[!highway][route!=road][!public_transport][type!~/route|street/][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*/][name!~/^(?i)estrada de ferro/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (not mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'road') and not mapcss._tag_capture(capture_tags, 2, tags, u'public_transport') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_72d45155), mapcss._tag_capture(capture_tags, 3, tags, u'type')) and mapcss._tag_capture(capture_tags, 4, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 6, self.re_15690541), mapcss._tag_capture(capture_tags, 6, tags, u'name'))) + try: match = (not mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'road') and not mapcss._tag_capture(capture_tags, 2, tags, u'public_transport') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_72d45155), mapcss._tag_capture(capture_tags, 3, tags, u'type')) and mapcss._tag_capture(capture_tags, 4, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 6, self.re_15690541), mapcss._tag_capture(capture_tags, 6, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto com nome de via mas sem tag de {0}","{0.key}") - err.append({'class': 9018002, 'subclass': 874993957, 'text': mapcss.tr(u'objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 535280341, 'text': mapcss.tr(u'objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # way[highway=track][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|rodovia|rotatória|rua|travessa|trevo|viela) .*/] + # way[highway=track][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|rodovia|rotatória|rua|travessa|trevo|viela) .*/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'track') and mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_20cf30ba), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'track') and mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_20cf30ba), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não classificar via como {0}","{0.tag}") # suggestAlternative:"highway=residential" # suggestAlternative:"highway=unclassified" - err.append({'class': 9018051, 'subclass': 450185002, 'text': mapcss.tr(u'não classificar via como {0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018051, 'subclass': 1145810098, 'text': mapcss.tr(u'não classificar via como {0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/] + # *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4bd3b925), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4bd3b925), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("utilizar espaço ao invés de underscore") - err.append({'class': 9018002, 'subclass': 378801374, 'text': mapcss.tr(u'utilizar espaço ao invés de underscore')}) + err.append({'class': 9018002, 'subclass': 1476954926, 'text': mapcss.tr(u'utilizar espaço ao invés de underscore')}) - # *[name=~/(?i)(^|.* )(Cel|Cmte|Cond|Conj|Dª|Dr|Eng|Gov|Hab|Jd|Jr|Marg|Mun|p\/|Pde|Pe|Pq|Pst|Pref|Profa|Profª|Prof|Res|s\/|Sr(a|ª)?|Sta|Sto|Ver)\.? .*/] + # *[name=~/(?i)(^|.* )(Cel|Cmte|Cond|Conj|Dª|Dr|Eng|Gov|Hab|Jd|Jr|Marg|Mun|p\/|Pde|Pe|Pq|Pst|Pref|Profa|Profª|Prof|Res|s\/|Sr(a|ª)?|Sta|Sto|Ver)\.? .*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_178f5446), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_178f5446), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("palavra abreviada em {0}","{0.key}") - err.append({'class': 9018003, 'subclass': 1784756763, 'text': mapcss.tr(u'palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018003, 'subclass': 749019091, 'text': mapcss.tr(u'palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # way[highway][name=~/^(?i)(?u)((via de )?(acesso|ligação)(( (a|à))? propriedade)?|entrada|entroncamento|rampa|retorno|rotat(ó|o)ria|r(ó|o)tula|sa(í|i)da|trevo|estrada( municipal| de terra)?|rua|rodovia|via)( (de acesso|sem nome|projetad(a|o)))?$/] + # way[highway][name=~/^(?i)(?u)((via de )?(acesso|ligação)(( (a|à))? propriedade)?|entrada|entroncamento|rampa|retorno|rotat(ó|o)ria|r(ó|o)tula|sa(í|i)da|trevo|estrada( municipal| de terra)?|rua|rodovia|via)( (de acesso|sem nome|projetad(a|o)))?$/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_667ce569), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_667ce569), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com nome supérfluo/incompleto","{0.key}") # suggestAlternative:"description" # suggestAlternative:"destination" - err.append({'class': 9018052, 'subclass': 729248989, 'text': mapcss.tr(u'{0} com nome supérfluo/incompleto', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018052, 'subclass': 736885884, 'text': mapcss.tr(u'{0} com nome supérfluo/incompleto', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/] + # *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/][inside("BR")] if (u'leisure' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome supérfluo/incompleto de local de lazer") - err.append({'class': 9018004, 'subclass': 790401825, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de lazer')}) + err.append({'class': 9018004, 'subclass': 1485441713, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de lazer')}) - # *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/] + # *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_52ab3b8b), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_52ab3b8b), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome supérfluo/incompleto de local de saúde") - err.append({'class': 9018005, 'subclass': 1792576894, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de saúde')}) + err.append({'class': 9018005, 'subclass': 1497769259, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de saúde')}) - # *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/] + # *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ab76b11), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ab76b11), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("erro de ortografia em ''saúde''") - err.append({'class': 9018002, 'subclass': 1455303428, 'text': mapcss.tr(u'erro de ortografia em \'\'saúde\'\'')}) + err.append({'class': 9018002, 'subclass': 1962359328, 'text': mapcss.tr(u'erro de ortografia em \'\'saúde\'\'')}) - # *[place=farm][name^="Sitio "] + # *[place=farm][name^="Sitio "][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'farm') and mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, u'name'), mapcss._value_capture(capture_tags, 1, u'Sitio '))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'farm') and mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, u'name'), mapcss._value_capture(capture_tags, 1, u'Sitio ')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("faltando acento em ''Sítio''") - err.append({'class': 9018002, 'subclass': 962677162, 'text': mapcss.tr(u'faltando acento em \'\'Sítio\'\'')}) + err.append({'class': 9018002, 'subclass': 653860263, 'text': mapcss.tr(u'faltando acento em \'\'Sítio\'\'')}) - # *[name=~/^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$/] + # *[name=~/^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_20c7dd98), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_20c7dd98), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("local com nome supérfluo, incompleto ou descritivo") - err.append({'class': 9018002, 'subclass': 501162763, 'text': mapcss.tr(u'local com nome supérfluo, incompleto ou descritivo')}) + err.append({'class': 9018002, 'subclass': 1104230922, 'text': mapcss.tr(u'local com nome supérfluo, incompleto ou descritivo')}) - # *[amenity=parking][name=~/(?i)^Estacionamento /] + # *[amenity=parking][name=~/(?i)^Estacionamento /][inside("BR")] # Rule Blacklisted - # way[highway][type=route] + # way[highway][type=route][inside("BR")] if (u'highway' in keys and u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'type') == mapcss._value_capture(capture_tags, 1, u'route')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'type') == mapcss._value_capture(capture_tags, 1, u'route') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} não deve possuir {1}","{0.key}","{1.tag}") - err.append({'class': 9018053, 'subclass': 1357959449, 'text': mapcss.tr(u'{0} não deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + err.append({'class': 9018053, 'subclass': 1158257088, 'text': mapcss.tr(u'{0} não deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) - # way[highway][highway!~/bus_stop|milestone|motorway_junction|traffic_signals/][ref][ref!~/^(([A-Z]{2,3}-[0-9]{2,4}|SPM(-| )[0-9]{3} ?(D|E)?|SP(A|D|I)(-| )[0-9]{3}\/[0-9]{3}|[A-Z]{3}-[0-9]{3}\/[0-9]{3});?)+$/] + # way[highway][highway!~/bus_stop|milestone|motorway_junction|traffic_signals/][ref][ref!~/^(([A-Z]{2,3}-[0-9]{2,4}|SPM(-| )[0-9]{3} ?(D|E)?|SP(A|D|I)(-| )[0-9]{3}\/[0-9]{3}|[A-Z]{3}-[0-9]{3}\/[0-9]{3});?)+$/][inside("BR")] # Rule Blacklisted - # way[highway][!ref][name=~/.*([A-Z]{2,3}-[0-9]{2,4}|SPM(-| )[0-9]{3} ?(D|E)?|SP(A|D|I)(-| )[0-9]{3}\/[0-9]{3}|[A-Z]{3}-[0-9]{3}\/[0-9]{3}).*/] + # way[highway][!ref][name=~/.*([A-Z]{2,3}-[0-9]{2,4}|SPM(-| )[0-9]{3} ?(D|E)?|SP(A|D|I)(-| )[0-9]{3}\/[0-9]{3}|[A-Z]{3}-[0-9]{3}\/[0-9]{3}).*/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and not mapcss._tag_capture(capture_tags, 1, tags, u'ref') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_375e3de4), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and not mapcss._tag_capture(capture_tags, 1, tags, u'ref') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_375e3de4), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("utilizar o código/sigla da rodovia também na tag {0}","{1.key}") - err.append({'class': 9018002, 'subclass': 1854606955, 'text': mapcss.tr(u'utilizar o código/sigla da rodovia também na tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 2109205925, 'text': mapcss.tr(u'utilizar o código/sigla da rodovia também na tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # way[highway][name=~/Rodovia ([A-Z]{2,3}-[0-9]{2,4})/] + # way[highway][name=~/Rodovia ([A-Z]{2,3}-[0-9]{2,4})/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7633bf4e), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7633bf4e), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("nome incorreto de rodovia; utilizar o nome oficial ou apenas ref") - err.append({'class': 9018002, 'subclass': 955724850, 'text': mapcss.tr(u'nome incorreto de rodovia; utilizar o nome oficial ou apenas ref')}) - - # way[name=*"addr:street"][highway] - # *[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] + err.append({'class': 9018002, 'subclass': 718023291, 'text': mapcss.tr(u'nome incorreto de rodovia; utilizar o nome oficial ou apenas ref')}) + + # way[name=*"addr:street"][highway][inside("BR")] + # *[designation=*"addr:housename"][inside("BR")] + # *[ref=*designation][inside("BR")] + # *[ref=*old_ref][inside("BR")] + # *[name=*"addr:housename"][inside("BR")] + # *[name=*designation][inside("BR")] + # *[name=*alt_name][inside("BR")] + # *[name=*int_name][inside("BR")] + # *[name=*loc_name][inside("BR")] + # *[name=*nat_name][inside("BR")] + # *[name=*official_name][inside("BR")] + # *[name=*old_name][inside("BR")] + # *[name=*reg_name][inside("BR")] + # *[name=*short_name][inside("BR")] + # *[name=*sorting_name][inside("BR")] # Rule Blacklisted - # *[source=*name] + # *[source=*name][inside("BR")] if (u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} e {1} são iguais","{0.key}","{0.value}") - err.append({'class': 9018002, 'subclass': 1403015964, 'text': mapcss.tr(u'{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 470146003, 'text': mapcss.tr(u'{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/] + # *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_65710fdb), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_65710fdb), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto com nomenclatura incorreta") # suggestAlternative:"noname" - err.append({'class': 9018007, 'subclass': 506924923, 'text': mapcss.tr(u'objeto com nomenclatura incorreta')}) + err.append({'class': 9018007, 'subclass': 1272098213, 'text': mapcss.tr(u'objeto com nomenclatura incorreta')}) - # *[designation] + # *[designation][inside("BR")] if (u'designation' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} é uma chave utilizada apenas no Reino Unido","{0.key}") # suggestAlternative:"description" # suggestAlternative:"name" - err.append({'class': 9018009, 'subclass': 1259259930, 'text': mapcss.tr(u'{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018009, 'subclass': 1818234763, 'text': mapcss.tr(u'{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # way[highway=~/^(trunk|motorway)$/][!operator] + # way[highway=~/^(trunk|motorway)$/][!operator][inside("BR")] # Rule Blacklisted - # way[highway$=_link][name=~/(Alameda|Avenida|Rua|Travessa|Viela) .*/] + # way[highway$=_link][name=~/(Alameda|Avenida|Rua|Travessa|Viela) .*/][inside("BR")] # Rule Blacklisted - # way[highway][name=~/(Alameda|Avenida|Rua|Travessa|Viela) .*/][ref] + # way[highway][name=~/(Alameda|Avenida|Rua|Travessa|Viela) .*/][ref][inside("BR")] if (u'highway' in keys and u'name' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6b6e390d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6b6e390d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("possível uso desnecessário/errado de ref em {0}={1}","{0.key}",tag("highway")) - err.append({'class': 9018002, 'subclass': 1325624158, 'text': mapcss.tr(u'possível uso desnecessário/errado de ref em {0}={1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'highway'))}) + err.append({'class': 9018002, 'subclass': 227495312, 'text': mapcss.tr(u'possível uso desnecessário/errado de ref em {0}={1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'highway'))}) - # *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000] + # *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_152c10ee), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 100000)) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_152c10ee), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 100000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com 100.000 habitantes ou mais deve ser classificado como city") # fixAdd:"place=city" - err.append({'class': 9018006, 'subclass': 149235075, 'text': mapcss.tr(u'local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1009134521, 'text': mapcss.tr(u'local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'city']]) }}) - # *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000] + # *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_591572a5), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 10000) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 100000)) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_591572a5), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 10000) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 100000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com população entre 10.000 e 100.000 deve ser classificado como town") # fixAdd:"place=town" - err.append({'class': 9018006, 'subclass': 1174321645, 'text': mapcss.tr(u'local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1343568198, 'text': mapcss.tr(u'local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'town']]) }}) - # *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000] + # *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3aeda39d), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 10000)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3aeda39d), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 10000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com menos de 10.000 habitantes deve ser classificado como village") # fixAdd:"place=village" - err.append({'class': 9018006, 'subclass': 719699918, 'text': mapcss.tr(u'local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 409005616, 'text': mapcss.tr(u'local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'village']]) }}) - # *[place=city][!population] - # *[place=town][!population] - # *[place=village][!population] + # *[place=city][!population][inside("BR")] + # *[place=town][!population][inside("BR")] + # *[place=village][!population][inside("BR")] # Rule Blacklisted - # *[place=city][!name] - # *[place=town][!name] - # *[place=village][!name] + # *[place=city][!name][inside("BR")] + # *[place=town][!name][inside("BR")] + # *[place=village][!name][inside("BR")] if (u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'city') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'city') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'town') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'town') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'village') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'village') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} sem nome","{0.value}") - err.append({'class': 9018012, 'subclass': 828568305, 'text': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018012, 'subclass': 1473808194, 'text': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *["addr:city"=~/(,|( |-) ?[A-Z]{2})/] + # *["addr:city"=~/(,|( |-) ?[A-Z]{2})/][inside("BR")] if (u'addr:city' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_10f1c360), mapcss._tag_capture(capture_tags, 0, tags, u'addr:city'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_10f1c360), mapcss._tag_capture(capture_tags, 0, tags, u'addr:city')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve conter apenas o nome da cidade","{0.key}") - err.append({'class': 9018013, 'subclass': 223700239, 'text': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018013, 'subclass': 1479274467, 'text': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/] + # *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2cd1e949), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5d3348cb), mapcss._tag_capture(capture_tags, 2, tags, u'place'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2cd1e949), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5d3348cb), mapcss._tag_capture(capture_tags, 2, tags, u'place')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto talvez deva ser {0}=farm","{1.key}") - err.append({'class': 9018002, 'subclass': 414255329, 'text': mapcss.tr(u'objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 337742963, 'text': mapcss.tr(u'objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/] + # *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_64387998), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_64387998), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto talvez não deva ter ''Bairro'' no nome") - err.append({'class': 9018002, 'subclass': 457937105, 'text': mapcss.tr(u'objeto talvez não deva ter \'\'Bairro\'\' no nome')}) + err.append({'class': 9018002, 'subclass': 1441242115, 'text': mapcss.tr(u'objeto talvez não deva ter \'\'Bairro\'\' no nome')}) - # *[iata="0"] + # *[iata="0"][inside("BR")] if (u'iata' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'iata') == mapcss._value_capture(capture_tags, 0, u'0')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'iata') == mapcss._value_capture(capture_tags, 0, u'0') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com valor = {1}","{0.key}","{0.value}") - err.append({'class': 9018014, 'subclass': 1389202412, 'text': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018014, 'subclass': 1098244333, 'text': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/] + # *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_362f879f), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_362f879f), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("estabelecimento de ensino classificado incorretamente") # suggestAlternative:"amenity=university" # fixAdd:"{0.key}=university" - err.append({'class': 9018006, 'subclass': 221523813, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1605707172, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=university')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)/] - # *[amenity=~/school|university/][name=~/(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b/] + # *[amenity=school][name=~/^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)/][inside("BR")] + # *[amenity=~/school|university/][name=~/(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6c0d6e9e), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6c0d6e9e), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("estabelecimento de ensino classificado incorretamente") # suggestAlternative:"amenity=college" # fixAdd:"{0.key}=college" - err.append({'class': 9018006, 'subclass': 897019825, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1282773099, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=college')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/] + # *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("autoescola classificada incorretamente") # suggestAlternative:"amenity=driving_school" # fixAdd:"{0.key}=driving_school" - err.append({'class': 9018006, 'subclass': 1796023580, 'text': mapcss.tr(u'autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 566309924, 'text': mapcss.tr(u'autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=driving_school')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)creche\b/] + # *[amenity=school][name=~/^(?i)creche\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("creche classificada incorretamente") # suggestAlternative:"amenity=kindergarten" # fixAdd:"{0.key}=kindergarten" - err.append({'class': 9018006, 'subclass': 121701344, 'text': mapcss.tr(u'creche classificada incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1847987722, 'text': mapcss.tr(u'creche classificada incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=kindergarten')).split('=', 1)]) }}) - # *[name=~/^(?i)(?u)Subestação .*/][power][power!=substation] - # *[name=~/^(?i)(?u)Fórum .*/][amenity][amenity!=courthouse] - # *[name=~/^(?i)Hospital .*/][building][building!=hospital] - # *[name=~/^(?i)Universidade .*/][building][building!=university] - # *[name=~/^(?i)Escola .*/][building][building!=school] - # *[name=~/^(?i)Hotel .*/][building][building!=hotel] - # *[name=~/^(?i)Capela .*/][building][building!=chapel] - # *[name=~/^(?i)Igreja .*/][building][building!=church] - # *[name=~/^(?i)Catedral .*/][building][building!=cathedral] - # *[name=~/^(?i)Fazenda .*/][building][building!=farm] - # *[name=~/^(?i)Supermercado .*/][building][building!=supermarket] + # *[name=~/^(?i)(?u)Subestação .*/][power][power!=substation][inside("BR")] + # *[name=~/^(?i)(?u)Fórum .*/][amenity][amenity!=courthouse][inside("BR")] + # *[name=~/^(?i)Hospital .*/][building][building!=hospital][inside("BR")] + # *[name=~/^(?i)Universidade .*/][building][building!=university][inside("BR")] + # *[name=~/^(?i)Escola .*/][building][building!=school][inside("BR")] + # *[name=~/^(?i)Hotel .*/][building][building!=hotel][inside("BR")] + # *[name=~/^(?i)Capela .*/][building][building!=chapel][inside("BR")] + # *[name=~/^(?i)Igreja .*/][building][building!=church][inside("BR")] + # *[name=~/^(?i)Catedral .*/][building][building!=cathedral][inside("BR")] + # *[name=~/^(?i)Fazenda .*/][building][building!=farm][inside("BR")] + # *[name=~/^(?i)Supermercado .*/][building][building!=supermarket][inside("BR")] # Rule Blacklisted - # *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital] + # *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7b7c453d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') == mapcss._value_capture(capture_tags, 1, u'hospital')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7b7c453d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') == mapcss._value_capture(capture_tags, 1, u'hospital') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: + # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("postos/unidades de saúde devem ser amenity=clinic") - err.append({'class': 9018015, 'subclass': 2108543140, 'text': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic')}) + # fixAdd:"amenity=clinic" + err.append({'class': 9018006, 'subclass': 74419437, 'text': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'amenity',u'clinic']]) + }}) - # *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/] + # *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2dbaea13), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, u'amenity'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2dbaea13), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, u'amenity')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("SAMU classificado de forma errada") # suggestAlternative:"emergency=ambulance_station" - err.append({'class': 9018016, 'subclass': 2090365947, 'text': mapcss.tr(u'SAMU classificado de forma errada')}) + err.append({'class': 9018016, 'subclass': 392029310, 'text': mapcss.tr(u'SAMU classificado de forma errada')}) - # way[highway=give_way] - # way[highway=mini_roundabout] - # way[highway=stop] - # way[highway=turning_circle] + # way[highway=give_way][inside("BR")] + # way[highway=mini_roundabout][inside("BR")] + # way[highway=stop][inside("BR")] + # way[highway=turning_circle][inside("BR")] if (u'highway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'give_way')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'give_way') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'mini_roundabout')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'mini_roundabout') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'stop')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'stop') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'turning_circle')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'turning_circle') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser utilizado apenas em nós","{0.tag}") - err.append({'class': 9018047, 'subclass': 2084016255, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em nós', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018047, 'subclass': 1154213374, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em nós', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[crossing][!highway][!railway] + # way[highway][junction=circular][!oneway?][inside("BR")] + if (u'highway' in keys and u'junction' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'junction') == mapcss._value_capture(capture_tags, 1, u'circular') and not mapcss._tag_capture(capture_tags, 2, tags, u'oneway') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("junção circular sem ''oneway''") + # fixAdd:"oneway=yes" + err.append({'class': 9018002, 'subclass': 1396859077, 'text': mapcss.tr(u'junção circular sem \'\'oneway\'\''), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'oneway',u'yes']]) + }}) + + # *[crossing][!highway][!railway][inside("BR")] if (u'crossing' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'crossing') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'crossing') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser utilizado com {1}={0} ou {2}={0}","{0.key}","{1.key}","{2.key}") - err.append({'class': 9018019, 'subclass': 139983185, 'text': mapcss.tr(u'{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018019, 'subclass': 2098306424, 'text': mapcss.tr(u'{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[aeroway][designation=~/^[A-Z]{4}$/][!icao] - # *[aeroway][ref=~/^[A-Z]{4}$/][!icao] + # *[aeroway][designation=~/^[A-Z]{4}$/][!icao][inside("BR")] + # *[aeroway][ref=~/^[A-Z]{4}$/][!icao][inside("BR")] if (u'aeroway' in keys and u'designation' in keys) or (u'aeroway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'designation')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'designation')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'ref')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'ref')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} provavelmente deve ser utilizado como {1}","{1.key}","{2.key}") # fixChangeKey:"{1.key} => {2.key}" - err.append({'class': 9018006, 'subclass': 662001655, 'text': mapcss.tr(u'{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 619372172, 'text': mapcss.tr(u'{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [(mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[1].strip(), mapcss.tag(tags, (mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[0].strip())]]), '-': ([ (mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[0].strip()]) }}) - # *[access=permissive] + # *[access=permissive][inside("BR")] if (u'access' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'access') == mapcss._value_capture(capture_tags, 0, u'permissive')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'access') == mapcss._value_capture(capture_tags, 0, u'permissive') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público","{0.tag}") - err.append({'class': 9018002, 'subclass': 1918455197, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 1240816112, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[name=~/^(?U)(\p{Upper}| )+$/] - # *["addr:street"=~/^(?U)(\p{Upper}| )+$/] + # *[name=~/^(?U)(\p{Upper}| )+$/][inside("BR")] + # *["addr:street"=~/^(?U)(\p{Upper}| )+$/][inside("BR")] # Rule Blacklisted - # *["addr:postcode"=~/^[0-9]{8}$/] + # *["addr:postcode"=~/^[0-9]{8}$/][inside("BR")] # Rule Blacklisted - # *[postal_code=~/^[0-9]{8}$/] + # *[postal_code=~/^[0-9]{8}$/][inside("BR")] # Rule Blacklisted - # *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/] + # *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")] if (u'addr:postcode' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'addr:postcode'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'addr:postcode')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("formato do CEP pode ser melhorado") # fixAdd:concat("addr:postcode=",replace(replace(tag("addr:postcode")," ","-"),".","-")) - err.append({'class': 9018006, 'subclass': 308348773, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1667206075, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'addr:postcode=', mapcss.replace(mapcss.replace(mapcss.tag(tags, u'addr:postcode'), u' ', u'-'), u'.', u'-'))).split('=', 1)]) }}) - # *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/] + # *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")] if (u'postal_code' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'postal_code'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'postal_code')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("formato do CEP pode ser melhorado") # fixAdd:concat("postal_code=",replace(replace(tag("postal_code")," ","-"),".","-")) - err.append({'class': 9018006, 'subclass': 1211220107, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1977906896, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'postal_code=', mapcss.replace(mapcss.replace(mapcss.tag(tags, u'postal_code'), u' ', u'-'), u'.', u'-'))).split('=', 1)]) }}) - # *["addr:postcode"]["addr:postcode"!~/^[0-9]{5}-[0-9]{3}$/] - # *[postal_code][postal_code!~/^[0-9]{5}-[0-9]{3}$/] + # *["addr:postcode"]["addr:postcode"!~/^[0-9]{5}-[0-9]{3}$/][inside("BR")] + # *[postal_code][postal_code!~/^[0-9]{5}-[0-9]{3}$/][inside("BR")] # Rule Blacklisted - # way[highway]["addr:postcode"][highway!=services] + # way[highway]["addr:postcode"][highway!=services][inside("BR")] if (u'addr:postcode' in keys and u'highway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:postcode') and mapcss._tag_capture(capture_tags, 2, tags, u'highway') != mapcss._value_capture(capture_tags, 2, u'services')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:postcode') and mapcss._tag_capture(capture_tags, 2, tags, u'highway') != mapcss._value_capture(capture_tags, 2, u'services') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("uso incorreto de {0}","{1.key}","{0.key}") # suggestAlternative:"postal_code" # fixChangeKey:"{1.key} => postal_code" - err.append({'class': 9018006, 'subclass': 1893232368, 'text': mapcss.tr(u'uso incorreto de {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 314748788, 'text': mapcss.tr(u'uso incorreto de {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [(mapcss._tag_uncapture(capture_tags, u'{1.key} => postal_code')).split('=>', 1)[1].strip(), mapcss.tag(tags, (mapcss._tag_uncapture(capture_tags, u'{1.key} => postal_code')).split('=>', 1)[0].strip())]]), '-': ([ (mapcss._tag_uncapture(capture_tags, u'{1.key} => postal_code')).split('=>', 1)[0].strip()]) }}) - # *[alt_source][source] + # *[alt_source][source][inside("BR")] if (u'alt_source' in keys and u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_source') and mapcss._tag_capture(capture_tags, 1, tags, u'source')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_source') and mapcss._tag_capture(capture_tags, 1, tags, u'source') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve estar incluído em {1}, separado por '';'' caso necessário","{0.key}","{1.key}") - err.append({'class': 9018020, 'subclass': 512568644, 'text': mapcss.tr(u'{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018020, 'subclass': 472956812, 'text': mapcss.tr(u'{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[landuse?] + # *[landuse?][inside("BR")] if (u'landuse' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("especificar valor correto para {0} ao invés de ''{1}''","{0.key}",tag("landuse")) - err.append({'class': 9018021, 'subclass': 2004192493, 'text': mapcss.tr(u'especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'landuse'))}) + err.append({'class': 9018021, 'subclass': 6418462, 'text': mapcss.tr(u'especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'landuse'))}) - # *[long_name] + # *[long_name][inside("BR")] if (u'long_name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'long_name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'long_name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("chave inválida: {0}","{0.key}") # suggestAlternative:"alt_name" # suggestAlternative:"name" # suggestAlternative:"official_name" - err.append({'class': 9018022, 'subclass': 1648910015, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018022, 'subclass': 1737555221, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["building:levels"<1] + # *["building:levels"<1][inside("BR")] if (u'building:levels' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:levels') < mapcss._value_capture(capture_tags, 0, 1)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:levels') < mapcss._value_capture(capture_tags, 0, 1) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com valor inválido","{0.key}") - err.append({'class': 9018002, 'subclass': 154478605, 'text': mapcss.tr(u'{0} com valor inválido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 775859422, 'text': mapcss.tr(u'{0} com valor inválido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[hires?] + # *[hires?][inside("BR")] if (u'hires' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'hires') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'hires') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não se deve utilizar {0} para demarcar áreas de cobertura de imagem","{0.key}") - err.append({'class': 9018023, 'subclass': 1394305840, 'text': mapcss.tr(u'não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018023, 'subclass': 895278192, 'text': mapcss.tr(u'não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[tourism=motel][amenity!=love_hotel] - # *[name=~/(?i)\bmotel\b/][amenity!=love_hotel] + # *[tourism=motel][amenity!=love_hotel][inside("BR")] + # *[name=~/(?i)\bmotel\b/][amenity!=love_hotel][inside("BR")] if (u'name' in keys) or (u'tourism' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'motel') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'motel') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_01454d46), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_01454d46), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("ausência de tag ''{0}''","{1.value}") # fixAdd:"{1.key}={1.value}" - err.append({'class': 9018006, 'subclass': 444111908, 'text': mapcss.tr(u'ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{1.value}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1987370859, 'text': mapcss.tr(u'ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{1.value}')), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{1.key}={1.value}')).split('=', 1)]) }}) - # *[amenity=love_hotel][tourism][tourism!=motel] + # *[amenity=love_hotel][tourism][tourism!=motel][inside("BR")] if (u'amenity' in keys and u'tourism' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'love_hotel') and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') and mapcss._tag_capture(capture_tags, 2, tags, u'tourism') != mapcss._value_capture(capture_tags, 2, u'motel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'love_hotel') and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') and mapcss._tag_capture(capture_tags, 2, tags, u'tourism') != mapcss._value_capture(capture_tags, 2, u'motel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("provavelmente deve ser ''{0}={1}''","{2.key}","{2.value}") - err.append({'class': 9018002, 'subclass': 2021262051, 'text': mapcss.tr(u'provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'))}) + err.append({'class': 9018002, 'subclass': 1760828878, 'text': mapcss.tr(u'provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'))}) - # *[name=~/(?i)^motel\b/][tourism!=motel] + # *[name=~/(?i)^motel\b/][tourism!=motel][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5cd37790), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') != mapcss._value_capture(capture_tags, 1, u'motel')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5cd37790), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') != mapcss._value_capture(capture_tags, 1, u'motel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("motel classificado incorretamente") # suggestAlternative:"tourism=motel" - err.append({'class': 9018002, 'subclass': 2096064741, 'text': mapcss.tr(u'motel classificado incorretamente')}) + err.append({'class': 9018002, 'subclass': 1456128106, 'text': mapcss.tr(u'motel classificado incorretamente')}) - # *[aeroway=aerodrome][name=~/(?i).*airport$/] - # *[aeroway=helipad][name=~/(?i).*heliport$/] + # *[aeroway=aerodrome][name=~/(?i).*airport$/][inside("BR")] + # *[aeroway=helipad][name=~/(?i).*heliport$/][inside("BR")] if (u'aeroway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com nome em inglês","{0.tag}") - err.append({'class': 9018002, 'subclass': 134725283, 'text': mapcss.tr(u'{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 1743601177, 'text': mapcss.tr(u'{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/] - # *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/] + # *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/][inside("BR")] + # *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/][inside("BR")] if (u'aeroway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("conferir se existe nome oficial do {0}","{0.value}") - err.append({'class': 9018002, 'subclass': 2002284471, 'text': mapcss.tr(u'conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 136467214, 'text': mapcss.tr(u'conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[aeroway=aerodrome][ref] + # *[aeroway=aerodrome][ref][inside("BR")] if (u'aeroway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss._tag_capture(capture_tags, 1, tags, u'ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss._tag_capture(capture_tags, 1, tags, u'ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("''{0}'' não faz sentido em aeroporto","{1.key}") - err.append({'class': 9018002, 'subclass': 339634841, 'text': mapcss.tr(u'\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 1633437696, 'text': mapcss.tr(u'\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # way[waterway][tunnel=yes] + # way[waterway][tunnel=yes][inside("BR")] # Rule Blacklisted - # way[highway][layer<0][!tunnel] - # *[waterway][layer<0][!tunnel] + # way[highway][layer<0][!tunnel][inside("BR")] + # *[waterway][layer<0][!tunnel][inside("BR")] # Rule Blacklisted - # way[highway][layer>0][!bridge][highway!=bus_stop] - # *[waterway][layer>0][!bridge] + # way[highway][layer>0][!bridge][highway!=bus_stop][inside("BR")] + # *[waterway][layer>0][!bridge][inside("BR")] # Rule Blacklisted - # *[layer][!building][!highway][man_made!=pipeline][!railway][!waterway] + # *[layer][!building][!highway][man_made!=pipeline][!railway][!waterway][power!=line][inside("BR")] # Rule Blacklisted - # way[highway=motorway_junction] + # way[highway=motorway_junction][inside("BR")] if (u'highway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'motorway_junction') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("{0} deve ser utilizado apenas no nó de saída da rodovia","{0.tag}") # suggestAlternative:"highway=motorway_link" - err.append({'class': 9018056, 'subclass': 260528564, 'text': mapcss.tr(u'{0} deve ser utilizado apenas no nó de saída da rodovia', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018056, 'subclass': 687515179, 'text': mapcss.tr(u'{0} deve ser utilizado apenas no nó de saída da rodovia', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[name=~/^(?i)(?u)edifício.*/][!building] + # *[name=~/^(?i)(?u)edifício.*/][!building][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_38a8f0ff), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'building')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_38a8f0ff), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'building') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("possível ausência de tag {0}","{1.key}") - err.append({'class': 9018026, 'subclass': 1417041710, 'text': mapcss.tr(u'possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018026, 'subclass': 1332986859, 'text': mapcss.tr(u'possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[route=ferry][!duration] + # way[highway][maxspeed][maxspeed!~/^[0-9]+$/][inside("BR")] + if (u'highway' in keys and u'maxspeed' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_066203d3), mapcss._tag_capture(capture_tags, 2, tags, u'maxspeed')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("velocidade máxima deve ser apenas o valor numérico, em km/h") + err.append({'class': 9018002, 'subclass': 78890622, 'text': mapcss.tr(u'velocidade máxima deve ser apenas o valor numérico, em km/h')}) + + # way[highway][maxspeed][maxspeed!~/^[0-9]+0$/][inside("BR")] + if (u'highway' in keys and u'maxspeed' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_67c67cf2), mapcss._tag_capture(capture_tags, 2, tags, u'maxspeed')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("velocidade máxima deveria ser múltiplo de 10") + err.append({'class': 9018002, 'subclass': 1298210435, 'text': mapcss.tr(u'velocidade máxima deveria ser múltiplo de 10')}) + + # *[route=ferry][!duration][inside("BR")] if (u'route' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'ferry') and not mapcss._tag_capture(capture_tags, 1, tags, u'duration')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'ferry') and not mapcss._tag_capture(capture_tags, 1, tags, u'duration') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("ausência do tempo de duração ({0}) da balsa","{1.key}") - err.append({'class': 9018027, 'subclass': 1289884816, 'text': mapcss.tr(u'ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018027, 'subclass': 1343391603, 'text': mapcss.tr(u'ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[name=~/^(?i)(?u)praça.*/][!leisure][landuse=~/^(forest|grass|greenfield|meadow|orchard)$/] - # *[name=~/^(?i)(?u)praça.*/][!leisure][natural=~/^(grassland|heath|scrub|wood)$/] + # *[name=~/^(?i)(?u)praça.*/][!leisure][landuse=~/^(forest|grass|greenfield|meadow|orchard)$/][inside("BR")] + # *[name=~/^(?i)(?u)praça.*/][!leisure][natural=~/^(grassland|heath|scrub|wood)$/][inside("BR")] if (u'landuse' in keys and u'name' in keys) or (u'name' in keys and u'natural' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_05a345c7), mapcss._tag_capture(capture_tags, 2, tags, u'landuse'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_05a345c7), mapcss._tag_capture(capture_tags, 2, tags, u'landuse')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_12b48afb), mapcss._tag_capture(capture_tags, 2, tags, u'natural'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_12b48afb), mapcss._tag_capture(capture_tags, 2, tags, u'natural')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("possível definição incorreta para praça: ''{0}''","{2.key}") # suggestAlternative:"leisure=park" - err.append({'class': 9018029, 'subclass': 80498829, 'text': mapcss.tr(u'possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018029, 'subclass': 181066872, 'text': mapcss.tr(u'possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[wikipedia][wikipedia!~/^pt:/] + # *[wikipedia][wikipedia!~/^pt:/][inside("BR")] if (u'wikipedia' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_17fd35b3), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_17fd35b3), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("utilizar prefixo em português (pt:) para {0}","{0.key}") - err.append({'class': 9018030, 'subclass': 1219382195, 'text': mapcss.tr(u'utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018030, 'subclass': 1431112366, 'text': mapcss.tr(u'utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # way[highway][lanes=1][!oneway?][!junction][!narrow] + # way[highway][lanes=1][!oneway?][!junction][!narrow][inside("BR")] # Rule Blacklisted - # way[cycleway=lane]["cycleway:left"=lane] - # way[cycleway=lane]["cycleway:right"=lane] + # way[cycleway=lane]["cycleway:left"=lane][inside("BR")] + # way[cycleway=lane]["cycleway:right"=lane][inside("BR")] if (u'cycleway' in keys and u'cycleway:left' in keys) or (u'cycleway' in keys and u'cycleway:right' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cycleway') == mapcss._value_capture(capture_tags, 0, u'lane') and mapcss._tag_capture(capture_tags, 1, tags, u'cycleway:left') == mapcss._value_capture(capture_tags, 1, u'lane')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cycleway') == mapcss._value_capture(capture_tags, 0, u'lane') and mapcss._tag_capture(capture_tags, 1, tags, u'cycleway:left') == mapcss._value_capture(capture_tags, 1, u'lane') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cycleway') == mapcss._value_capture(capture_tags, 0, u'lane') and mapcss._tag_capture(capture_tags, 1, tags, u'cycleway:right') == mapcss._value_capture(capture_tags, 1, u'lane')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cycleway') == mapcss._value_capture(capture_tags, 0, u'lane') and mapcss._tag_capture(capture_tags, 1, tags, u'cycleway:right') == mapcss._value_capture(capture_tags, 1, u'lane') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("uso incorreto de {0} com {1}","{0.tag}","{1.tag}") # suggestAlternative:"{1.tag}" - err.append({'class': 9018063, 'subclass': 528363416, 'text': mapcss.tr(u'uso incorreto de {0} com {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + err.append({'class': 9018063, 'subclass': 1071847858, 'text': mapcss.tr(u'uso incorreto de {0} com {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) - # *[name=~/.*\(.*\).*/] + # *[name=~/.*\(.*\).*/][inside("BR")] # Rule Blacklisted - # *[name=~/ - /] + # *[name=~/ - /][inside("BR")] # Rule Blacklisted - # *[name=~/, /] + # *[name=~/, /][inside("BR")] # Rule Blacklisted - # *[name=~/: /] + # *[name=~/: /][inside("BR")] # Rule Blacklisted - # *[name=~/ ou /] + # *[name=~/ ou /][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_131cc885), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_131cc885), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome utilizado de forma incorreta") # suggestAlternative:"name e alt_name" - err.append({'class': 9018031, 'subclass': 23034604, 'text': mapcss.tr(u'nome utilizado de forma incorreta')}) + err.append({'class': 9018031, 'subclass': 115703372, 'text': mapcss.tr(u'nome utilizado de forma incorreta')}) # way[boundary=administrative][!admin_level]!.way_in_relation # Use undeclared class way_in_relation - # way[place][place!~/^(city_block|farm|hamlet|island|islet|isolated_dwelling|neighbourhood|square)$/][!admin_level][!boundary] + # way[place][place!~/^(city_block|farm|hamlet|island|islet|isolated_dwelling|neighbourhood|square)$/][!admin_level][!boundary][inside("BR")] if (u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_58f616c9), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and not mapcss._tag_capture(capture_tags, 2, tags, u'admin_level') and not mapcss._tag_capture(capture_tags, 3, tags, u'boundary')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_58f616c9), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and not mapcss._tag_capture(capture_tags, 2, tags, u'admin_level') and not mapcss._tag_capture(capture_tags, 3, tags, u'boundary') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("local com ausência/incoerência de limite administrativo") - err.append({'class': 9018002, 'subclass': 372086249, 'text': mapcss.tr(u'local com ausência/incoerência de limite administrativo')}) + err.append({'class': 9018002, 'subclass': 1502787309, 'text': mapcss.tr(u'local com ausência/incoerência de limite administrativo')}) # way[admin_level][!boundary]!.way_in_relation # way[admin_level][boundary][boundary!=administrative]!.way_in_relation # Use undeclared class way_in_relation - # *[boundary=national_park][!name] - # *[boundary=protected_area][!name] - # *[leisure=nature_reserve][!name] + # *[boundary=national_park][!name][inside("BR")] + # *[boundary=protected_area][!name][inside("BR")] + # *[leisure=nature_reserve][!name][inside("BR")] if (u'boundary' in keys) or (u'leisure' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'national_park') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'national_park') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 1492609299, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 1196875584, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[boundary=protected_area][!protect_class] + # *[boundary=protected_area][!protect_class][inside("BR")] if (u'boundary' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'protect_class')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'protect_class') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 822952800, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 1593244126, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[protect_class][protect_class!~/^(1(a|b)?|[1-9][0-9]?)$/] + # *[protect_class][protect_class!~/^(1(a|b)?|[1-9][0-9]?)$/][inside("BR")] if (u'protect_class' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5ac7053e), mapcss._tag_capture(capture_tags, 1, tags, u'protect_class'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5ac7053e), mapcss._tag_capture(capture_tags, 1, tags, u'protect_class')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("valor incorreto para {0}","{0.key}") - err.append({'class': 9018034, 'subclass': 1459161459, 'text': mapcss.tr(u'valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018034, 'subclass': 1183781531, 'text': mapcss.tr(u'valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[protect_class][boundary!=protected_area] + # *[protect_class][boundary!=protected_area][inside("BR")] if (u'protect_class' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'protected_area')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'protected_area') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("ausência de boundary=protected_area") - err.append({'class': 9018035, 'subclass': 1208814760, 'text': mapcss.tr(u'ausência de boundary=protected_area')}) + err.append({'class': 9018035, 'subclass': 1649283274, 'text': mapcss.tr(u'ausência de boundary=protected_area')}) - # *[name=~/.* D(a|e|o)s? .*/] + # *[name=~/.* D(a|e|o)s? .*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2ffc377d), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2ffc377d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("''da'', ''de'' e ''do'' são minúsculos nos nomes em português") - err.append({'class': 9018002, 'subclass': 1986668346, 'text': mapcss.tr(u'\'\'da\'\', \'\'de\'\' e \'\'do\'\' são minúsculos nos nomes em português')}) + err.append({'class': 9018002, 'subclass': 874509528, 'text': mapcss.tr(u'\'\'da\'\', \'\'de\'\' e \'\'do\'\' são minúsculos nos nomes em português')}) - # *[name=~/^[a-z].*/] + # *[name=~/^[a-z].*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_39d67968), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_39d67968), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("nome iniciando com letra minúscula") - err.append({'class': 9018002, 'subclass': 167462302, 'text': mapcss.tr(u'nome iniciando com letra minúscula')}) + err.append({'class': 9018002, 'subclass': 2073274467, 'text': mapcss.tr(u'nome iniciando com letra minúscula')}) - # *[alt_ref] + # *[alt_ref][inside("BR")] if (u'alt_ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("o conteúdo de {0} deve fazer parte de ref, separado por ;","{0.key}") # suggestAlternative:"ref" - err.append({'class': 9018039, 'subclass': 722411109, 'text': mapcss.tr(u'o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018039, 'subclass': 836388143, 'text': mapcss.tr(u'o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # way[highway=path][tracktype] + # way[highway=path][tracktype][inside("BR")] if (u'highway' in keys and u'tracktype' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'path') and mapcss._tag_capture(capture_tags, 1, tags, u'tracktype')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'path') and mapcss._tag_capture(capture_tags, 1, tags, u'tracktype') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("uso incorreto de {0}","{1.key}") # suggestAlternative:"trail_visibility" - err.append({'class': 9018064, 'subclass': 2113951549, 'text': mapcss.tr(u'uso incorreto de {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018064, 'subclass': 1242889729, 'text': mapcss.tr(u'uso incorreto de {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # way[highway!=track][tracktype] + # way[highway!=track][tracktype][inside("BR")] # Rule Blacklisted - # *[surface][eval(number_of_tags())=1] + # *[surface][eval(number_of_tags())=1][inside("BR")] if (u'surface' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'surface') and len(tags) == 1) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'surface') and len(tags) == 1 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto incompleto: possui apenas {0}","{0.key}") - err.append({'class': 9018041, 'subclass': 1776991136, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018041, 'subclass': 411244066, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name][surface][eval(number_of_tags())=2] - # *[name][website][eval(number_of_tags())=2] + # *[name][surface][eval(number_of_tags())=2][inside("BR")] + # *[name][website][eval(number_of_tags())=2][inside("BR")] if (u'name' in keys and u'surface' in keys) or (u'name' in keys and u'website' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and len(tags) == 2) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and len(tags) == 2 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'website') and len(tags) == 2) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'website') and len(tags) == 2 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto incompleto: possui apenas {0} e {1}","{0.key}","{1.key}") - err.append({'class': 9018042, 'subclass': 626126700, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018042, 'subclass': 585137381, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # way[highway=~/^(living_street|pedestrian|residential|road|service|track)$/][ref] + # way[highway=~/^(living_street|pedestrian|residential|road|service|track)$/][ref][inside("BR")] if (u'highway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_07f31a73), mapcss._tag_capture(capture_tags, 0, tags, u'highway')) and mapcss._tag_capture(capture_tags, 1, tags, u'ref')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_07f31a73), mapcss._tag_capture(capture_tags, 0, tags, u'highway')) and mapcss._tag_capture(capture_tags, 1, tags, u'ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("a via deve ser ao menos tertiary") - err.append({'class': 9018002, 'subclass': 1461580029, 'text': mapcss.tr(u'a via deve ser ao menos tertiary')}) + err.append({'class': 9018002, 'subclass': 728045324, 'text': mapcss.tr(u'a via deve ser ao menos tertiary')}) - # way[bridge][!layer] - # way[tunnel][!layer] + # way[bridge][!layer][inside("BR")] + # way[tunnel][!layer][inside("BR")] # Rule Blacklisted - # *[leisure=pitch][sport=tennis][surface=unpaved] + # *[leisure=pitch][sport=tennis][surface=unpaved][inside("BR")] if (u'leisure' in keys and u'sport' in keys and u'surface' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'pitch') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') == mapcss._value_capture(capture_tags, 1, u'tennis') and mapcss._tag_capture(capture_tags, 2, tags, u'surface') == mapcss._value_capture(capture_tags, 2, u'unpaved')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'pitch') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') == mapcss._value_capture(capture_tags, 1, u'tennis') and mapcss._tag_capture(capture_tags, 2, tags, u'surface') == mapcss._value_capture(capture_tags, 2, u'unpaved') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} com superfície incorreta","{2.key}") # suggestAlternative:"surface=clay" # fixAdd:"surface=clay" - err.append({'class': 9018006, 'subclass': 1659179489, 'text': mapcss.tr(u'{0} com superfície incorreta', mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 990400213, 'text': mapcss.tr(u'{0} com superfície incorreta', mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'surface',u'clay']]) }}) - # *[amenity=fuel][name=~/(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b/] + # way[leisure=track][!area?][inside("BR")]:closed + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'track') and not mapcss._tag_capture(capture_tags, 1, tags, u'area') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR') and nds[0] == nds[-1]) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("adicionar ''area=yes'' caso esteja representando uma área") + err.append({'class': 9018002, 'subclass': 691633247, 'text': mapcss.tr(u'adicionar \'\'area=yes\'\' caso esteja representando uma área')}) + + # *[amenity=fuel][name=~/(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_604bb645), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_604bb645), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") - # throwWarning:tr("uso incorreto da bandeira do posto") + # throwWarning:tr("o nome não deve conter a bandeira/marca do posto") # suggestAlternative:"brand" - err.append({'class': 9018002, 'subclass': 935774110, 'text': mapcss.tr(u'uso incorreto da bandeira do posto')}) + err.append({'class': 9018002, 'subclass': 1724035987, 'text': mapcss.tr(u'o nome não deve conter a bandeira/marca do posto')}) - # *[/_[0-9]$/][!"is_in:iso_3166_2"] + # *[amenity=fuel][brand=BR][inside("BR")] + if (u'amenity' in keys and u'brand' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss._tag_capture(capture_tags, 1, tags, u'brand') == mapcss._value_capture(capture_tags, 1, u'BR') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("uso inconsistente de bandeira do posto") + # suggestAlternative:"brand=Petrobras" + # fixAdd:"brand=Petrobras" + err.append({'class': 9018002, 'subclass': 435141543, 'text': mapcss.tr(u'uso inconsistente de bandeira do posto'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'brand',u'Petrobras']]) + }}) + + # *[shop=gas][name=~/(?i)(?u)^(Brasilg(á|a)s|Consigaz|Copagaz|Liquig(á|a)s|Minasg(á|a)s|Nacional G(á|a)s|Supergasbras|Ultragaz)$/][inside("BR")] + if (u'name' in keys and u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'gas') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_31732cd0), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("o nome não deve conter a bandeira/marca da loja") + # suggestAlternative:"brand" + err.append({'class': 9018002, 'subclass': 867102166, 'text': mapcss.tr(u'o nome não deve conter a bandeira/marca da loja')}) + + # *[/_[0-9]$/][!"is_in:iso_3166_2"][inside("BR")] if True: match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_57b8ef8e) and not mapcss._tag_capture(capture_tags, 1, tags, u'is_in:iso_3166_2')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_57b8ef8e) and not mapcss._tag_capture(capture_tags, 1, tags, u'is_in:iso_3166_2') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("chave inválida: {0}","{0.key}") - err.append({'class': 9018022, 'subclass': 331369569, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018022, 'subclass': 231229079, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][!note] + # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][!note][inside("BR")] if (u'addr:housenumber' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and not mapcss._tag_capture(capture_tags, 1, tags, u'note')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and not mapcss._tag_capture(capture_tags, 1, tags, u'note') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") @@ -2543,132 +2840,283 @@ def way(self, data, tags, nds): # suggestAlternative:"note" # fixRemove:"addr:housenumber" # fixAdd:"note=Local sem número" - err.append({'class': 9018006, 'subclass': 931902546, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 630415638, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'note',u'Local sem número']]), '-': ([ u'addr:housenumber']) }}) - # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][note] + # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][note][inside("BR")] if (u'addr:housenumber' in keys and u'note' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and mapcss._tag_capture(capture_tags, 1, tags, u'note')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and mapcss._tag_capture(capture_tags, 1, tags, u'note') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não utilizar ''{0}'' para locais sem número",tag("addr:housenumber")) # suggestAlternative:"note" - err.append({'class': 9018043, 'subclass': 1717284811, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber'))}) + err.append({'class': 9018043, 'subclass': 1150070765, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber'))}) - # *[source=~/(?i)google/] + # *[source=~/(?i)google/][inside("BR")] if (u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2e8e4f2b), mapcss._tag_capture(capture_tags, 0, tags, u'source'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2e8e4f2b), mapcss._tag_capture(capture_tags, 0, tags, u'source')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("objeto contém Google como source") - err.append({'class': 9018044, 'subclass': 1313403884, 'text': mapcss.tr(u'objeto contém Google como source')}) + err.append({'class': 9018044, 'subclass': 1159310436, 'text': mapcss.tr(u'objeto contém Google como source')}) - # *[amenity=townhall][name=~/^(?i)(?u)c(â|a)mara\b/] + # *[amenity=townhall][name=~/^(?i)(?u)c(â|a)mara\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("câmara de vereadores mapeada incorretamente") # suggestAlternative:"office=government + government=legislative" - err.append({'class': 9018002, 'subclass': 129695507, 'text': mapcss.tr(u'câmara de vereadores mapeada incorretamente')}) + err.append({'class': 9018002, 'subclass': 532372413, 'text': mapcss.tr(u'câmara de vereadores mapeada incorretamente')}) - # *[office=government][government!=legislative][name=~/^(?i)(?u)c(â|a)mara\b/] + # *[office=government][government!=legislative][name=~/^(?i)(?u)c(â|a)mara\b/][inside("BR")] if (u'name' in keys and u'office' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss._tag_capture(capture_tags, 1, tags, u'government') != mapcss._value_capture(capture_tags, 1, u'legislative') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss._tag_capture(capture_tags, 1, tags, u'government') != mapcss._value_capture(capture_tags, 1, u'legislative') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("ausência de government=legislative") - err.append({'class': 9018002, 'subclass': 869412796, 'text': mapcss.tr(u'ausência de government=legislative')}) + err.append({'class': 9018002, 'subclass': 2126685099, 'text': mapcss.tr(u'ausência de government=legislative')}) - # *[amenity=townhall][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/] - # *[office=government][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/] + # *[amenity=townhall][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/][inside("BR")] + # *[office=government][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys) or (u'name' in keys and u'office' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("erro de ortografia em ''câmara''") - err.append({'class': 9018002, 'subclass': 212328084, 'text': mapcss.tr(u'erro de ortografia em \'\'câmara\'\'')}) + err.append({'class': 9018002, 'subclass': 1277153079, 'text': mapcss.tr(u'erro de ortografia em \'\'câmara\'\'')}) + + # *[name=~/(?i)^prefeitura\b/][amenity!=townhall][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7ec1fb9a), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'townhall') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("prefeitura possivelmente mapeada de forma incorreta") + # suggestAlternative:"amenity=townhall" + err.append({'class': 9018002, 'subclass': 1445137044, 'text': mapcss.tr(u'prefeitura possivelmente mapeada de forma incorreta')}) + + # *[name=~/(?i)(?u)^paço\b/][amenity!=townhall][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_13f4c147), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'townhall') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("paço possivelmente mapeado de forma incorreta") + # suggestAlternative:"amenity=townhall" + err.append({'class': 9018002, 'subclass': 1169494638, 'text': mapcss.tr(u'paço possivelmente mapeado de forma incorreta')}) - # *[amenity=charging_station] + # *[amenity=charging_station][inside("BR")] if (u'amenity' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'charging_station')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'charging_station') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("possivelmente deve ser amenity=fuel") - err.append({'class': 9018002, 'subclass': 128902291, 'text': mapcss.tr(u'possivelmente deve ser amenity=fuel')}) + err.append({'class': 9018002, 'subclass': 2011797637, 'text': mapcss.tr(u'possivelmente deve ser amenity=fuel')}) - # *[name=~/(?i)^Borrach(aria|eiro)/][shop=tyres][!repair] + # *[name=~/(?i)^Borrach(aria|eiro)/][shop=tyres][!repair][inside("BR")] if (u'name' in keys and u'shop' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') == mapcss._value_capture(capture_tags, 1, u'tyres') and not mapcss._tag_capture(capture_tags, 2, tags, u'repair')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') == mapcss._value_capture(capture_tags, 1, u'tyres') and not mapcss._tag_capture(capture_tags, 2, tags, u'repair') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("borracharia sem ''repair=yes''") # suggestAlternative:"repair=yes" - err.append({'class': 9018002, 'subclass': 817061630, 'text': mapcss.tr(u'borracharia sem \'\'repair=yes\'\'')}) + err.append({'class': 9018002, 'subclass': 1225518759, 'text': mapcss.tr(u'borracharia sem \'\'repair=yes\'\'')}) - # *[name=~/(?i)^Borrach(aria|eiro)/][shop!=tyres] + # *[name=~/(?i)^Borrach(aria|eiro)/][shop!=tyres][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') != mapcss._value_capture(capture_tags, 1, u'tyres')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') != mapcss._value_capture(capture_tags, 1, u'tyres') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("borracharia sem ''shop=tyres''") # suggestAlternative:"shop=tyres" - err.append({'class': 9018002, 'subclass': 1324999258, 'text': mapcss.tr(u'borracharia sem \'\'shop=tyres\'\'')}) + err.append({'class': 9018002, 'subclass': 755877630, 'text': mapcss.tr(u'borracharia sem \'\'shop=tyres\'\'')}) - # way[waterway=~/^(river|stream)$/][name][name!~/^(?U)(Água|Arroio|Cabeceira|Córrego|Furo|Grota|Igarapé|Lajeado|Paraná|Restinga|Riacho|Ribeirão|Rio|Sanga)\b/] - # way[waterway=~/^(river|stream)$/][alt_name][alt_name!~/^(?U)(Água|Arroio|Cabeceira|Córrego|Furo|Grota|Igarapé|Lajeado|Paraná|Restinga|Riacho|Ribeirão|Rio|Sanga)\b/] + # way[waterway=~/^(river|stream)$/][name][name!~/^(?U)(Água|Arroio|Cabeceira|Córrego|Furo|Grota|Igarapé|Lajeado|Paraná|Restinga|Riacho|Ribeirão|Rio|Sanga)\b/][inside("BR")] + # way[waterway=~/^(river|stream)$/][alt_name][alt_name!~/^(?U)(Água|Arroio|Cabeceira|Córrego|Furo|Grota|Igarapé|Lajeado|Paraná|Restinga|Riacho|Ribeirão|Rio|Sanga)\b/][inside("BR")] if (u'alt_name' in keys and u'waterway' in keys) or (u'name' in keys and u'waterway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_04873a60), mapcss._tag_capture(capture_tags, 0, tags, u'waterway')) and mapcss._tag_capture(capture_tags, 1, tags, u'name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_280004fd), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_04873a60), mapcss._tag_capture(capture_tags, 0, tags, u'waterway')) and mapcss._tag_capture(capture_tags, 1, tags, u'name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_280004fd), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_04873a60), mapcss._tag_capture(capture_tags, 0, tags, u'waterway')) and mapcss._tag_capture(capture_tags, 1, tags, u'alt_name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_280004fd), mapcss._tag_capture(capture_tags, 2, tags, u'alt_name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_04873a60), mapcss._tag_capture(capture_tags, 0, tags, u'waterway')) and mapcss._tag_capture(capture_tags, 1, tags, u'alt_name') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_280004fd), mapcss._tag_capture(capture_tags, 2, tags, u'alt_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com possível nome errado/incompleto",tag(waterway)) - err.append({'class': 9018002, 'subclass': 1906904535, 'text': mapcss.tr(u'{0} com possível nome errado/incompleto', mapcss.tag(tags, u'waterway'))}) + err.append({'class': 9018002, 'subclass': 139982797, 'text': mapcss.tr(u'{0} com possível nome errado/incompleto', mapcss.tag(tags, u'waterway'))}) + + # *[name=~/(?i)\bcoreto\b/][leisure!=bandstand][leisure!=park][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6e34cd0f), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'leisure') != mapcss._value_capture(capture_tags, 1, u'bandstand') and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') != mapcss._value_capture(capture_tags, 2, u'park') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("coreto possivelmente classificado de forma incorreta") + # suggestAlternative:"leisure=bandstand" + err.append({'class': 9018002, 'subclass': 810497942, 'text': mapcss.tr(u'coreto possivelmente classificado de forma incorreta')}) + + # *[leisure=recreation_ground][inside("BR")] + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'recreation_ground') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} impreciso","{0.tag}") + # suggestAlternative:"landuse=recreation_ground" + # suggestAlternative:"leisure=park" + err.append({'class': 9018002, 'subclass': 1594563801, 'text': mapcss.tr(u'{0} impreciso', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[leisure=recreation_ground][landuse=recreation_ground][inside("BR")] + if (u'landuse' in keys and u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'recreation_ground') and mapcss._tag_capture(capture_tags, 1, tags, u'landuse') == mapcss._value_capture(capture_tags, 1, u'recreation_ground') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} supérfluo","{0.tag}") + # fixRemove:"leisure" + err.append({'class': 9018002, 'subclass': 627419845, 'text': mapcss.tr(u'{0} supérfluo', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'leisure']) + }}) + + # *["ref:vatin"]["ref:vatin"!~/^BR[0-9]{14}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_524288b6), mapcss._tag_capture(capture_tags, 1, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("CNPJ diferente do formato BRxxxxxxxxxxxxxx") + err.append({'class': 9018002, 'subclass': 1793026117, 'text': mapcss.tr(u'CNPJ diferente do formato BRxxxxxxxxxxxxxx')}) + + # *["ref:vatin"=~/^[0-9]{2}\.[0-9]{3}\.[0-9]{3}\/[0-9]{4}-[0-9]{2}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ddbb7eb), mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Correções e melhorias") + # throwWarning:tr("formato do CNPJ pode ser melhorado em {0}","{0.key}") + # fixAdd:concat("ref:vatin=BR",replace(replace(replace(tag("ref:vatin"),"/",""),".",""),"-","")) + err.append({'class': 9018006, 'subclass': 1609978963, 'text': mapcss.tr(u'formato do CNPJ pode ser melhorado em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + (mapcss.concat(u'ref:vatin=BR', mapcss.replace(mapcss.replace(mapcss.replace(mapcss.tag(tags, u'ref:vatin'), u'/', u''), u'.', u''), u'-', u''))).split('=', 1)]) + }}) + + # *["ref:vatin"=~/^(br|bR|Br)[0-9]{14}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_408831d0), mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Correções e melhorias") + # throwWarning:tr("CNPJ deve iniciar maiúsculo: BRxxxxxxxxxxxxxx") + # fixAdd:concat("ref:vatin=",upper(tag("ref:vatin"))) + err.append({'class': 9018006, 'subclass': 1616044431, 'text': mapcss.tr(u'CNPJ deve iniciar maiúsculo: BRxxxxxxxxxxxxxx'), 'allow_fix_override': True, 'fix': { + '+': dict([ + (mapcss.concat(u'ref:vatin=', mapcss.upper(mapcss.tag(tags, u'ref:vatin')))).split('=', 1)]) + }}) + + # *[phone][phone!~/^(\+55|0800)/][inside("BR")] + # *["contact:phone"]["contact:phone"!~/^(\+55|0800)/][inside("BR")] + if (u'contact:phone' in keys) or (u'phone' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'phone') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_243f4993), mapcss._tag_capture(capture_tags, 1, tags, u'phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'contact:phone') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_243f4993), mapcss._tag_capture(capture_tags, 1, tags, u'contact:phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} em formato diferente do internacional +55 XX YYYY-YYYY","{0.key}") + err.append({'class': 9018002, 'subclass': 1438682200, 'text': mapcss.tr(u'{0} em formato diferente do internacional +55 XX YYYY-YYYY', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + + # *[phone=~/^(100|18{0,1}|19[0-9])$/][inside("BR")] + # *["contact:phone"=~/^(100|18{0,1}|19[0-9])$/][inside("BR")] + if (u'contact:phone' in keys) or (u'phone' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7a246e93), mapcss._tag_capture(capture_tags, 0, tags, u'phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7a246e93), mapcss._tag_capture(capture_tags, 0, tags, u'contact:phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("não usar número de emergência em {0}","{0.key}") + # fixRemove:"{0.key}" + err.append({'class': 9018002, 'subclass': 371146161, 'text': mapcss.tr(u'não usar número de emergência em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) return err @@ -2678,1125 +3126,1160 @@ def relation(self, data, tags, members): err = [] - # relation[highway][name=~/\b[A-Z]{2,3} (- )?[0-9]{2,3}\b/] + # relation[highway][name=~/\b[A-Z]{2,3} (- )?[0-9]{2,3}\b/][inside("BR")] if (u'highway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_073e5345), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_073e5345), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("rodovia com ref no nome") - err.append({'class': 9018045, 'subclass': 523480189, 'text': mapcss.tr(u'rodovia com ref no nome')}) + err.append({'class': 9018045, 'subclass': 1625358529, 'text': mapcss.tr(u'rodovia com ref no nome')}) - # *["addr:street"]["addr:street"!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/] + # *["addr:street"]["addr:street"!~/^(Aeroporto|Alameda|Área|Avenida|([1-9][0-9]?º )?Beco|Boulevard|Calçadão|Caminho|Campo|Chácara|Colônia|Condomínio|Conjunto|Contorno|Distrito|Elevado|Esplanada|Estação|Estrada|Favela|Fazenda|Feira|Jardim|Ladeira|Lago|Lagoa|Largo|Loteamento|Marginal|Morro|Núcleo|([1-9][0-9]?ª )?Paralela|Parque|Passagem|Passarela|Pátio|Ponte|Praça|Quadra|Recanto|Residencial|Rodovia|Rotatória|Rua|Servidão|Setor|Sítio|([1-9][0-9]?ª )?Subida|([1-9][0-9]?ª )?Travessa|Trecho|Trevo|Túnel|Vale|Vereda|Via|Viadutos?|Viela|Vila|(Anel|Complexo|Dispositivo) (Rodo)?(V|v)iário) .*/][inside("BR")] if (u'addr:street' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b777b9d), mapcss._tag_capture(capture_tags, 1, tags, u'addr:street'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6bf570a0), mapcss._tag_capture(capture_tags, 1, tags, u'addr:street')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com logradouro ausente, errado ou abreviado","{0.key}") - err.append({'class': 9018001, 'subclass': 588331445, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018001, 'subclass': 279840772, 'text': mapcss.tr(u'{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[!highway][route!=road][!public_transport][type!~/route|street/][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*/][name!~/^(?i)estrada de ferro/] + # *[!highway][route!=road][!public_transport][type!~/route|street/][name][name=~/^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|passarela|rodovia|rotatória|rua|travessa|trevo|viela|(anel|complexo|dispositivo) viário) .*/][name!~/^(?i)estrada de ferro/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (not mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'road') and not mapcss._tag_capture(capture_tags, 2, tags, u'public_transport') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_72d45155), mapcss._tag_capture(capture_tags, 3, tags, u'type')) and mapcss._tag_capture(capture_tags, 4, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 6, self.re_15690541), mapcss._tag_capture(capture_tags, 6, tags, u'name'))) + try: match = (not mapcss._tag_capture(capture_tags, 0, tags, u'highway') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'road') and not mapcss._tag_capture(capture_tags, 2, tags, u'public_transport') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_72d45155), mapcss._tag_capture(capture_tags, 3, tags, u'type')) and mapcss._tag_capture(capture_tags, 4, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 6, self.re_15690541), mapcss._tag_capture(capture_tags, 6, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto com nome de via mas sem tag de {0}","{0.key}") - err.append({'class': 9018002, 'subclass': 874993957, 'text': mapcss.tr(u'objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 535280341, 'text': mapcss.tr(u'objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/] + # *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4bd3b925), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4bd3b925), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("utilizar espaço ao invés de underscore") - err.append({'class': 9018002, 'subclass': 378801374, 'text': mapcss.tr(u'utilizar espaço ao invés de underscore')}) + err.append({'class': 9018002, 'subclass': 1476954926, 'text': mapcss.tr(u'utilizar espaço ao invés de underscore')}) - # *[name=~/(?i)(^|.* )(Cel|Cmte|Cond|Conj|Dª|Dr|Eng|Gov|Hab|Jd|Jr|Marg|Mun|p\/|Pde|Pe|Pq|Pst|Pref|Profa|Profª|Prof|Res|s\/|Sr(a|ª)?|Sta|Sto|Ver)\.? .*/] + # *[name=~/(?i)(^|.* )(Cel|Cmte|Cond|Conj|Dª|Dr|Eng|Gov|Hab|Jd|Jr|Marg|Mun|p\/|Pde|Pe|Pq|Pst|Pref|Profa|Profª|Prof|Res|s\/|Sr(a|ª)?|Sta|Sto|Ver)\.? .*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_178f5446), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_178f5446), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("palavra abreviada em {0}","{0.key}") - err.append({'class': 9018003, 'subclass': 1784756763, 'text': mapcss.tr(u'palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018003, 'subclass': 749019091, 'text': mapcss.tr(u'palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/] + # *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/][inside("BR")] if (u'leisure' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome supérfluo/incompleto de local de lazer") - err.append({'class': 9018004, 'subclass': 790401825, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de lazer')}) + err.append({'class': 9018004, 'subclass': 1485441713, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de lazer')}) - # *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/] + # *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_52ab3b8b), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_52ab3b8b), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome supérfluo/incompleto de local de saúde") - err.append({'class': 9018005, 'subclass': 1792576894, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de saúde')}) + err.append({'class': 9018005, 'subclass': 1497769259, 'text': mapcss.tr(u'nome supérfluo/incompleto de local de saúde')}) - # *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/] + # *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ab76b11), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ab76b11), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("erro de ortografia em ''saúde''") - err.append({'class': 9018002, 'subclass': 1455303428, 'text': mapcss.tr(u'erro de ortografia em \'\'saúde\'\'')}) + err.append({'class': 9018002, 'subclass': 1962359328, 'text': mapcss.tr(u'erro de ortografia em \'\'saúde\'\'')}) - # *[place=farm][name^="Sitio "] + # *[place=farm][name^="Sitio "][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'farm') and mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, u'name'), mapcss._value_capture(capture_tags, 1, u'Sitio '))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'farm') and mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, u'name'), mapcss._value_capture(capture_tags, 1, u'Sitio ')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("faltando acento em ''Sítio''") - err.append({'class': 9018002, 'subclass': 962677162, 'text': mapcss.tr(u'faltando acento em \'\'Sítio\'\'')}) + err.append({'class': 9018002, 'subclass': 653860263, 'text': mapcss.tr(u'faltando acento em \'\'Sítio\'\'')}) - # *[name=~/^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$/] + # *[name=~/^(?i)(?u)(aldeia|borrach(aria|eiro)|bosque|capela|cemit(é|e)rio|c(ó|o)rrego|escola|estacionamento|fazenda|floresta|hospital|igreja|lago|lagoa|mata( nativa)?|praça|parque|parquinho|posto( de gasolina)?|riacho|rio|rodovi(á|a)ria|vila)$/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_20c7dd98), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_20c7dd98), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("local com nome supérfluo, incompleto ou descritivo") - err.append({'class': 9018002, 'subclass': 501162763, 'text': mapcss.tr(u'local com nome supérfluo, incompleto ou descritivo')}) + err.append({'class': 9018002, 'subclass': 1104230922, 'text': mapcss.tr(u'local com nome supérfluo, incompleto ou descritivo')}) - # *[amenity=parking][name=~/(?i)^Estacionamento /] + # *[amenity=parking][name=~/(?i)^Estacionamento /][inside("BR")] # Rule Blacklisted - # relation[type=route][highway] + # relation[type=route][highway][inside("BR")] if (u'highway' in keys and u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'route') and mapcss._tag_capture(capture_tags, 1, tags, u'highway')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'route') and mapcss._tag_capture(capture_tags, 1, tags, u'highway') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("relação não deve possuir {0}","{1.key}") - err.append({'class': 9018046, 'subclass': 890277462, 'text': mapcss.tr(u'relação não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - - # *[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] + err.append({'class': 9018046, 'subclass': 954714547, 'text': mapcss.tr(u'relação não deve possuir {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + + # *[designation=*"addr:housename"][inside("BR")] + # *[ref=*designation][inside("BR")] + # *[ref=*old_ref][inside("BR")] + # *[name=*"addr:housename"][inside("BR")] + # *[name=*designation][inside("BR")] + # *[name=*alt_name][inside("BR")] + # *[name=*int_name][inside("BR")] + # *[name=*loc_name][inside("BR")] + # *[name=*nat_name][inside("BR")] + # *[name=*official_name][inside("BR")] + # *[name=*old_name][inside("BR")] + # *[name=*reg_name][inside("BR")] + # *[name=*short_name][inside("BR")] + # *[name=*sorting_name][inside("BR")] if (u'designation' in keys) or (u'name' in keys) or (u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_ref'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_ref')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'addr:housename')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'designation')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'alt_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'alt_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'int_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'int_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'loc_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'loc_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'nat_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'nat_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'official_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'official_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'old_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'reg_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'reg_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'short_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'short_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'sorting_name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'sorting_name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} e {1} são iguais; remover chave {1} desnecessária","{0.key}","{0.value}") # fixRemove:"{0.value}" - err.append({'class': 9018006, 'subclass': 1882388489, 'text': mapcss.tr(u'{0} e {1} são iguais; remover chave {1} desnecessária', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 2003922, 'text': mapcss.tr(u'{0} e {1} são iguais; remover chave {1} desnecessária', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}')), 'allow_fix_override': True, 'fix': { '-': ([ mapcss._tag_uncapture(capture_tags, u'{0.value}')]) }}) - # *[source=*name] + # *[source=*name][inside("BR")] if (u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} e {1} são iguais","{0.key}","{0.value}") - err.append({'class': 9018002, 'subclass': 1403015964, 'text': mapcss.tr(u'{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 470146003, 'text': mapcss.tr(u'{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/] + # *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_65710fdb), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_65710fdb), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto com nomenclatura incorreta") # suggestAlternative:"noname" - err.append({'class': 9018007, 'subclass': 506924923, 'text': mapcss.tr(u'objeto com nomenclatura incorreta')}) + err.append({'class': 9018007, 'subclass': 1272098213, 'text': mapcss.tr(u'objeto com nomenclatura incorreta')}) - # *[designation] + # *[designation][inside("BR")] if (u'designation' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'designation') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} é uma chave utilizada apenas no Reino Unido","{0.key}") # suggestAlternative:"description" # suggestAlternative:"name" - err.append({'class': 9018009, 'subclass': 1259259930, 'text': mapcss.tr(u'{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018009, 'subclass': 1818234763, 'text': mapcss.tr(u'{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000] + # *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_152c10ee), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 100000)) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_152c10ee), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 100000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com 100.000 habitantes ou mais deve ser classificado como city") # fixAdd:"place=city" - err.append({'class': 9018006, 'subclass': 149235075, 'text': mapcss.tr(u'local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1009134521, 'text': mapcss.tr(u'local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'city']]) }}) - # *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000] + # *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_591572a5), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 10000) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 100000)) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_591572a5), mapcss._tag_capture(capture_tags, 0, tags, u'place')) and mapcss._tag_capture(capture_tags, 1, tags, u'population') >= mapcss._value_capture(capture_tags, 1, 10000) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 100000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com população entre 10.000 e 100.000 deve ser classificado como town") # fixAdd:"place=town" - err.append({'class': 9018006, 'subclass': 1174321645, 'text': mapcss.tr(u'local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1343568198, 'text': mapcss.tr(u'local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'town']]) }}) - # *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000] + # *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000][inside("BR")] if (u'place' in keys and u'population' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3aeda39d), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 10000)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3aeda39d), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and mapcss._tag_capture(capture_tags, 2, tags, u'population') < mapcss._value_capture(capture_tags, 2, 10000) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("local com menos de 10.000 habitantes deve ser classificado como village") # fixAdd:"place=village" - err.append({'class': 9018006, 'subclass': 719699918, 'text': mapcss.tr(u'local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 409005616, 'text': mapcss.tr(u'local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'place',u'village']]) }}) - # *[place=city][!population] - # *[place=town][!population] - # *[place=village][!population] + # *[place=city][!population][inside("BR")] + # *[place=town][!population][inside("BR")] + # *[place=village][!population][inside("BR")] # Rule Blacklisted - # *[place=city][!name] - # *[place=town][!name] - # *[place=village][!name] + # *[place=city][!name][inside("BR")] + # *[place=town][!name][inside("BR")] + # *[place=village][!name][inside("BR")] if (u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'city') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'city') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'town') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'town') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'village') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') == mapcss._value_capture(capture_tags, 0, u'village') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} sem nome","{0.value}") - err.append({'class': 9018012, 'subclass': 828568305, 'text': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018012, 'subclass': 1473808194, 'text': mapcss.tr(u'{0} sem nome', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *["addr:city"=~/(,|( |-) ?[A-Z]{2})/] + # *["addr:city"=~/(,|( |-) ?[A-Z]{2})/][inside("BR")] if (u'addr:city' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_10f1c360), mapcss._tag_capture(capture_tags, 0, tags, u'addr:city'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_10f1c360), mapcss._tag_capture(capture_tags, 0, tags, u'addr:city')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve conter apenas o nome da cidade","{0.key}") - err.append({'class': 9018013, 'subclass': 223700239, 'text': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018013, 'subclass': 1479274467, 'text': mapcss.tr(u'{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/] + # *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2cd1e949), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5d3348cb), mapcss._tag_capture(capture_tags, 2, tags, u'place'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2cd1e949), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5d3348cb), mapcss._tag_capture(capture_tags, 2, tags, u'place')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto talvez deva ser {0}=farm","{1.key}") - err.append({'class': 9018002, 'subclass': 414255329, 'text': mapcss.tr(u'objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 337742963, 'text': mapcss.tr(u'objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/] + # *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/][inside("BR")] if (u'name' in keys and u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_64387998), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_64387998), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("objeto talvez não deva ter ''Bairro'' no nome") - err.append({'class': 9018002, 'subclass': 457937105, 'text': mapcss.tr(u'objeto talvez não deva ter \'\'Bairro\'\' no nome')}) + err.append({'class': 9018002, 'subclass': 1441242115, 'text': mapcss.tr(u'objeto talvez não deva ter \'\'Bairro\'\' no nome')}) - # *[iata="0"] + # *[iata="0"][inside("BR")] if (u'iata' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'iata') == mapcss._value_capture(capture_tags, 0, u'0')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'iata') == mapcss._value_capture(capture_tags, 0, u'0') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} com valor = {1}","{0.key}","{0.value}") - err.append({'class': 9018014, 'subclass': 1389202412, 'text': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018014, 'subclass': 1098244333, 'text': mapcss.tr(u'{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/] + # *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_362f879f), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_362f879f), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("estabelecimento de ensino classificado incorretamente") # suggestAlternative:"amenity=university" # fixAdd:"{0.key}=university" - err.append({'class': 9018006, 'subclass': 221523813, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1605707172, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=university')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)/] - # *[amenity=~/school|university/][name=~/(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b/] + # *[amenity=school][name=~/^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)/][inside("BR")] + # *[amenity=~/school|university/][name=~/(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6c0d6e9e), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6c0d6e9e), mapcss._tag_capture(capture_tags, 0, tags, u'amenity')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("estabelecimento de ensino classificado incorretamente") # suggestAlternative:"amenity=college" # fixAdd:"{0.key}=college" - err.append({'class': 9018006, 'subclass': 897019825, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1282773099, 'text': mapcss.tr(u'estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=college')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/] + # *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("autoescola classificada incorretamente") # suggestAlternative:"amenity=driving_school" # fixAdd:"{0.key}=driving_school" - err.append({'class': 9018006, 'subclass': 1796023580, 'text': mapcss.tr(u'autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 566309924, 'text': mapcss.tr(u'autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=driving_school')).split('=', 1)]) }}) - # *[amenity=school][name=~/^(?i)creche\b/] + # *[amenity=school][name=~/^(?i)creche\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'school') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("creche classificada incorretamente") # suggestAlternative:"amenity=kindergarten" # fixAdd:"{0.key}=kindergarten" - err.append({'class': 9018006, 'subclass': 121701344, 'text': mapcss.tr(u'creche classificada incorretamente'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1847987722, 'text': mapcss.tr(u'creche classificada incorretamente'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{0.key}=kindergarten')).split('=', 1)]) }}) - # *[name=~/^(?i)(?u)Subestação .*/][power][power!=substation] - # *[name=~/^(?i)(?u)Fórum .*/][amenity][amenity!=courthouse] - # *[name=~/^(?i)Hospital .*/][building][building!=hospital] - # *[name=~/^(?i)Universidade .*/][building][building!=university] - # *[name=~/^(?i)Escola .*/][building][building!=school] - # *[name=~/^(?i)Hotel .*/][building][building!=hotel] - # *[name=~/^(?i)Capela .*/][building][building!=chapel] - # *[name=~/^(?i)Igreja .*/][building][building!=church] - # *[name=~/^(?i)Catedral .*/][building][building!=cathedral] - # *[name=~/^(?i)Fazenda .*/][building][building!=farm] - # *[name=~/^(?i)Supermercado .*/][building][building!=supermarket] + # *[name=~/^(?i)(?u)Subestação .*/][power][power!=substation][inside("BR")] + # *[name=~/^(?i)(?u)Fórum .*/][amenity][amenity!=courthouse][inside("BR")] + # *[name=~/^(?i)Hospital .*/][building][building!=hospital][inside("BR")] + # *[name=~/^(?i)Universidade .*/][building][building!=university][inside("BR")] + # *[name=~/^(?i)Escola .*/][building][building!=school][inside("BR")] + # *[name=~/^(?i)Hotel .*/][building][building!=hotel][inside("BR")] + # *[name=~/^(?i)Capela .*/][building][building!=chapel][inside("BR")] + # *[name=~/^(?i)Igreja .*/][building][building!=church][inside("BR")] + # *[name=~/^(?i)Catedral .*/][building][building!=cathedral][inside("BR")] + # *[name=~/^(?i)Fazenda .*/][building][building!=farm][inside("BR")] + # *[name=~/^(?i)Supermercado .*/][building][building!=supermarket][inside("BR")] # Rule Blacklisted - # *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital] + # *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7b7c453d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') == mapcss._value_capture(capture_tags, 1, u'hospital')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7b7c453d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') == mapcss._value_capture(capture_tags, 1, u'hospital') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: + # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("postos/unidades de saúde devem ser amenity=clinic") - err.append({'class': 9018015, 'subclass': 2108543140, 'text': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic')}) + # fixAdd:"amenity=clinic" + err.append({'class': 9018006, 'subclass': 74419437, 'text': mapcss.tr(u'postos/unidades de saúde devem ser amenity=clinic'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'amenity',u'clinic']]) + }}) - # *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/] + # *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2dbaea13), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, u'amenity'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2dbaea13), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, u'amenity')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("SAMU classificado de forma errada") # suggestAlternative:"emergency=ambulance_station" - err.append({'class': 9018016, 'subclass': 2090365947, 'text': mapcss.tr(u'SAMU classificado de forma errada')}) + err.append({'class': 9018016, 'subclass': 392029310, 'text': mapcss.tr(u'SAMU classificado de forma errada')}) - # relation[highway=give_way] - # relation[highway=mini_roundabout] - # relation[highway=stop] - # relation[highway=turning_circle] + # relation[highway=give_way][inside("BR")] + # relation[highway=mini_roundabout][inside("BR")] + # relation[highway=stop][inside("BR")] + # relation[highway=turning_circle][inside("BR")] if (u'highway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'give_way')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'give_way') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'mini_roundabout')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'mini_roundabout') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'stop')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'stop') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'turning_circle')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'turning_circle') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser utilizado apenas em nós","{0.tag}") - err.append({'class': 9018047, 'subclass': 1663665792, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em nós', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018047, 'subclass': 484299691, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em nós', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # relation[enforcement=maxspeed][!maxspeed] - # relation[enforcement=maxheight][!maxheight] - # relation[enforcement=maxweight][!maxweight] + # relation[enforcement=maxspeed][!maxspeed][inside("BR")] + # relation[enforcement=maxheight][!maxheight][inside("BR")] + # relation[enforcement=maxweight][!maxweight][inside("BR")] if (u'enforcement' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'enforcement') == mapcss._value_capture(capture_tags, 0, u'maxspeed') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'enforcement') == mapcss._value_capture(capture_tags, 0, u'maxspeed') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'enforcement') == mapcss._value_capture(capture_tags, 0, u'maxheight') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxheight')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'enforcement') == mapcss._value_capture(capture_tags, 0, u'maxheight') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxheight') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'enforcement') == mapcss._value_capture(capture_tags, 0, u'maxweight') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxweight')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'enforcement') == mapcss._value_capture(capture_tags, 0, u'maxweight') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxweight') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("adicionar {0} ao {1}","{1.key}","{0.tag}") - err.append({'class': 9018018, 'subclass': 73808614, 'text': mapcss.tr(u'adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018018, 'subclass': 24087693, 'text': mapcss.tr(u'adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[crossing][!highway][!railway] + # *[crossing][!highway][!railway][inside("BR")] if (u'crossing' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'crossing') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'crossing') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser utilizado com {1}={0} ou {2}={0}","{0.key}","{1.key}","{2.key}") - err.append({'class': 9018019, 'subclass': 139983185, 'text': mapcss.tr(u'{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018019, 'subclass': 2098306424, 'text': mapcss.tr(u'{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[aeroway][designation=~/^[A-Z]{4}$/][!icao] - # *[aeroway][ref=~/^[A-Z]{4}$/][!icao] + # *[aeroway][designation=~/^[A-Z]{4}$/][!icao][inside("BR")] + # *[aeroway][ref=~/^[A-Z]{4}$/][!icao][inside("BR")] if (u'aeroway' in keys and u'designation' in keys) or (u'aeroway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'designation')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'designation')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'ref')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, u'ref')) and not mapcss._tag_capture(capture_tags, 2, tags, u'icao') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} provavelmente deve ser utilizado como {1}","{1.key}","{2.key}") # fixChangeKey:"{1.key} => {2.key}" - err.append({'class': 9018006, 'subclass': 662001655, 'text': mapcss.tr(u'{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 619372172, 'text': mapcss.tr(u'{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [(mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[1].strip(), mapcss.tag(tags, (mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[0].strip())]]), '-': ([ (mapcss._tag_uncapture(capture_tags, u'{1.key} => {2.key}')).split('=>', 1)[0].strip()]) }}) - # *[access=permissive] + # *[access=permissive][inside("BR")] if (u'access' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'access') == mapcss._value_capture(capture_tags, 0, u'permissive')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'access') == mapcss._value_capture(capture_tags, 0, u'permissive') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público","{0.tag}") - err.append({'class': 9018002, 'subclass': 1918455197, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 1240816112, 'text': mapcss.tr(u'{0} deve ser utilizado apenas em vias privadas com permissão de acesso e não em vias de acesso público', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[name=~/^(?U)(\p{Upper}| )+$/] - # *["addr:street"=~/^(?U)(\p{Upper}| )+$/] + # *[name=~/^(?U)(\p{Upper}| )+$/][inside("BR")] + # *["addr:street"=~/^(?U)(\p{Upper}| )+$/][inside("BR")] # Rule Blacklisted - # *["addr:postcode"=~/^[0-9]{8}$/] + # *["addr:postcode"=~/^[0-9]{8}$/][inside("BR")] # Rule Blacklisted - # *[postal_code=~/^[0-9]{8}$/] + # *[postal_code=~/^[0-9]{8}$/][inside("BR")] # Rule Blacklisted - # *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/] + # *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")] if (u'addr:postcode' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'addr:postcode'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'addr:postcode')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("formato do CEP pode ser melhorado") # fixAdd:concat("addr:postcode=",replace(replace(tag("addr:postcode")," ","-"),".","-")) - err.append({'class': 9018006, 'subclass': 308348773, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1667206075, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'addr:postcode=', mapcss.replace(mapcss.replace(mapcss.tag(tags, u'addr:postcode'), u' ', u'-'), u'.', u'-'))).split('=', 1)]) }}) - # *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/] + # *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")] if (u'postal_code' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'postal_code'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_57bee688), mapcss._tag_capture(capture_tags, 0, tags, u'postal_code')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("formato do CEP pode ser melhorado") # fixAdd:concat("postal_code=",replace(replace(tag("postal_code")," ","-"),".","-")) - err.append({'class': 9018006, 'subclass': 1211220107, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1977906896, 'text': mapcss.tr(u'formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'postal_code=', mapcss.replace(mapcss.replace(mapcss.tag(tags, u'postal_code'), u' ', u'-'), u'.', u'-'))).split('=', 1)]) }}) - # *["addr:postcode"]["addr:postcode"!~/^[0-9]{5}-[0-9]{3}$/] - # *[postal_code][postal_code!~/^[0-9]{5}-[0-9]{3}$/] + # *["addr:postcode"]["addr:postcode"!~/^[0-9]{5}-[0-9]{3}$/][inside("BR")] + # *[postal_code][postal_code!~/^[0-9]{5}-[0-9]{3}$/][inside("BR")] # Rule Blacklisted - # *[alt_source][source] + # *[alt_source][source][inside("BR")] if (u'alt_source' in keys and u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_source') and mapcss._tag_capture(capture_tags, 1, tags, u'source')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_source') and mapcss._tag_capture(capture_tags, 1, tags, u'source') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve estar incluído em {1}, separado por '';'' caso necessário","{0.key}","{1.key}") - err.append({'class': 9018020, 'subclass': 512568644, 'text': mapcss.tr(u'{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018020, 'subclass': 472956812, 'text': mapcss.tr(u'{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[landuse?] + # *[landuse?][inside("BR")] if (u'landuse' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("especificar valor correto para {0} ao invés de ''{1}''","{0.key}",tag("landuse")) - err.append({'class': 9018021, 'subclass': 2004192493, 'text': mapcss.tr(u'especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'landuse'))}) + err.append({'class': 9018021, 'subclass': 6418462, 'text': mapcss.tr(u'especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss.tag(tags, u'landuse'))}) - # *[long_name] + # *[long_name][inside("BR")] if (u'long_name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'long_name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'long_name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("chave inválida: {0}","{0.key}") # suggestAlternative:"alt_name" # suggestAlternative:"name" # suggestAlternative:"official_name" - err.append({'class': 9018022, 'subclass': 1648910015, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018022, 'subclass': 1737555221, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["building:levels"<1] + # *["building:levels"<1][inside("BR")] if (u'building:levels' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:levels') < mapcss._value_capture(capture_tags, 0, 1)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:levels') < mapcss._value_capture(capture_tags, 0, 1) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com valor inválido","{0.key}") - err.append({'class': 9018002, 'subclass': 154478605, 'text': mapcss.tr(u'{0} com valor inválido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018002, 'subclass': 775859422, 'text': mapcss.tr(u'{0} com valor inválido', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[hires?] + # *[hires?][inside("BR")] if (u'hires' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'hires') in ('yes', 'true', '1')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'hires') in ('yes', 'true', '1') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não se deve utilizar {0} para demarcar áreas de cobertura de imagem","{0.key}") - err.append({'class': 9018023, 'subclass': 1394305840, 'text': mapcss.tr(u'não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018023, 'subclass': 895278192, 'text': mapcss.tr(u'não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[tourism=motel][amenity!=love_hotel] - # *[name=~/(?i)\bmotel\b/][amenity!=love_hotel] + # *[tourism=motel][amenity!=love_hotel][inside("BR")] + # *[name=~/(?i)\bmotel\b/][amenity!=love_hotel][inside("BR")] if (u'name' in keys) or (u'tourism' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'motel') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'motel') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_01454d46), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_01454d46), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'love_hotel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("ausência de tag ''{0}''","{1.value}") # fixAdd:"{1.key}={1.value}" - err.append({'class': 9018006, 'subclass': 444111908, 'text': mapcss.tr(u'ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{1.value}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1987370859, 'text': mapcss.tr(u'ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{1.value}')), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss._tag_uncapture(capture_tags, u'{1.key}={1.value}')).split('=', 1)]) }}) - # *[amenity=love_hotel][tourism][tourism!=motel] + # *[amenity=love_hotel][tourism][tourism!=motel][inside("BR")] if (u'amenity' in keys and u'tourism' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'love_hotel') and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') and mapcss._tag_capture(capture_tags, 2, tags, u'tourism') != mapcss._value_capture(capture_tags, 2, u'motel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'love_hotel') and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') and mapcss._tag_capture(capture_tags, 2, tags, u'tourism') != mapcss._value_capture(capture_tags, 2, u'motel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("provavelmente deve ser ''{0}={1}''","{2.key}","{2.value}") - err.append({'class': 9018002, 'subclass': 2021262051, 'text': mapcss.tr(u'provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'))}) + err.append({'class': 9018002, 'subclass': 1760828878, 'text': mapcss.tr(u'provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'))}) - # *[name=~/(?i)^motel\b/][tourism!=motel] + # *[name=~/(?i)^motel\b/][tourism!=motel][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5cd37790), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') != mapcss._value_capture(capture_tags, 1, u'motel')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5cd37790), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'tourism') != mapcss._value_capture(capture_tags, 1, u'motel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("motel classificado incorretamente") # suggestAlternative:"tourism=motel" - err.append({'class': 9018002, 'subclass': 2096064741, 'text': mapcss.tr(u'motel classificado incorretamente')}) + err.append({'class': 9018002, 'subclass': 1456128106, 'text': mapcss.tr(u'motel classificado incorretamente')}) - # *[aeroway=aerodrome][name=~/(?i).*airport$/] - # *[aeroway=helipad][name=~/(?i).*heliport$/] + # *[aeroway=aerodrome][name=~/(?i).*airport$/][inside("BR")] + # *[aeroway=helipad][name=~/(?i).*heliport$/][inside("BR")] if (u'aeroway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} com nome em inglês","{0.tag}") - err.append({'class': 9018002, 'subclass': 134725283, 'text': mapcss.tr(u'{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9018002, 'subclass': 1743601177, 'text': mapcss.tr(u'{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/] - # *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/] + # *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/][inside("BR")] + # *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/][inside("BR")] if (u'aeroway' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'helipad') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("conferir se existe nome oficial do {0}","{0.value}") - err.append({'class': 9018002, 'subclass': 2002284471, 'text': mapcss.tr(u'conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9018002, 'subclass': 136467214, 'text': mapcss.tr(u'conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) - # *[aeroway=aerodrome][ref] + # *[aeroway=aerodrome][ref][inside("BR")] if (u'aeroway' in keys and u'ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss._tag_capture(capture_tags, 1, tags, u'ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'aeroway') == mapcss._value_capture(capture_tags, 0, u'aerodrome') and mapcss._tag_capture(capture_tags, 1, tags, u'ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("''{0}'' não faz sentido em aeroporto","{1.key}") - err.append({'class': 9018002, 'subclass': 339634841, 'text': mapcss.tr(u'\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018002, 'subclass': 1633437696, 'text': mapcss.tr(u'\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[waterway][layer<0][!tunnel] + # *[waterway][layer<0][!tunnel][inside("BR")] if (u'layer' in keys and u'waterway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') < mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'tunnel')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') < mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'tunnel') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} negativo de {1} com ausência de {2}","{1.key}","{0.key}","{2.key}") - err.append({'class': 9018002, 'subclass': 1476002587, 'text': mapcss.tr(u'{0} negativo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018002, 'subclass': 203420779, 'text': mapcss.tr(u'{0} negativo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[waterway][layer>0][!bridge] + # *[waterway][layer>0][!bridge][inside("BR")] if (u'layer' in keys and u'waterway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') > mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') and mapcss._tag_capture(capture_tags, 1, tags, u'layer') > mapcss._value_capture(capture_tags, 1, 0) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("{0} positivo de {1} com ausência de {2}","{1.key}","{0.key}","{2.key}") - err.append({'class': 9018002, 'subclass': 1137415389, 'text': mapcss.tr(u'{0} positivo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018002, 'subclass': 1870051659, 'text': mapcss.tr(u'{0} positivo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[layer][!building][!highway][man_made!=pipeline][!railway][!waterway] + # *[layer][!building][!highway][man_made!=pipeline][!railway][!waterway][power!=line][inside("BR")] # Rule Blacklisted - # *[name=~/^(?i)(?u)edifício.*/][!building] + # *[name=~/^(?i)(?u)edifício.*/][!building][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_38a8f0ff), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'building')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_38a8f0ff), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'building') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("possível ausência de tag {0}","{1.key}") - err.append({'class': 9018026, 'subclass': 1417041710, 'text': mapcss.tr(u'possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018026, 'subclass': 1332986859, 'text': mapcss.tr(u'possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[route=ferry][!duration] + # *[route=ferry][!duration][inside("BR")] if (u'route' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'ferry') and not mapcss._tag_capture(capture_tags, 1, tags, u'duration')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'ferry') and not mapcss._tag_capture(capture_tags, 1, tags, u'duration') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("ausência do tempo de duração ({0}) da balsa","{1.key}") - err.append({'class': 9018027, 'subclass': 1289884816, 'text': mapcss.tr(u'ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018027, 'subclass': 1343391603, 'text': mapcss.tr(u'ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[name=~/^(?i)(?u)praça.*/][!leisure][landuse=~/^(forest|grass|greenfield|meadow|orchard)$/] - # *[name=~/^(?i)(?u)praça.*/][!leisure][natural=~/^(grassland|heath|scrub|wood)$/] + # *[name=~/^(?i)(?u)praça.*/][!leisure][landuse=~/^(forest|grass|greenfield|meadow|orchard)$/][inside("BR")] + # *[name=~/^(?i)(?u)praça.*/][!leisure][natural=~/^(grassland|heath|scrub|wood)$/][inside("BR")] if (u'landuse' in keys and u'name' in keys) or (u'name' in keys and u'natural' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_05a345c7), mapcss._tag_capture(capture_tags, 2, tags, u'landuse'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_05a345c7), mapcss._tag_capture(capture_tags, 2, tags, u'landuse')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_12b48afb), mapcss._tag_capture(capture_tags, 2, tags, u'natural'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_4a8ca94e), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and not mapcss._tag_capture(capture_tags, 1, tags, u'leisure') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_12b48afb), mapcss._tag_capture(capture_tags, 2, tags, u'natural')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("possível definição incorreta para praça: ''{0}''","{2.key}") # suggestAlternative:"leisure=park" - err.append({'class': 9018029, 'subclass': 80498829, 'text': mapcss.tr(u'possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) + err.append({'class': 9018029, 'subclass': 181066872, 'text': mapcss.tr(u'possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[wikipedia][wikipedia!~/^pt:/] + # *[wikipedia][wikipedia!~/^pt:/][inside("BR")] if (u'wikipedia' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_17fd35b3), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_17fd35b3), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("utilizar prefixo em português (pt:) para {0}","{0.key}") - err.append({'class': 9018030, 'subclass': 1219382195, 'text': mapcss.tr(u'utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018030, 'subclass': 1431112366, 'text': mapcss.tr(u'utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/.*\(.*\).*/] + # *[name=~/.*\(.*\).*/][inside("BR")] # Rule Blacklisted - # *[name=~/ - /] + # *[name=~/ - /][inside("BR")] # Rule Blacklisted - # *[name=~/, /] + # *[name=~/, /][inside("BR")] # Rule Blacklisted - # *[name=~/: /] + # *[name=~/: /][inside("BR")] # Rule Blacklisted - # *[name=~/ ou /] + # *[name=~/ ou /][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_131cc885), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_131cc885), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("nome utilizado de forma incorreta") # suggestAlternative:"name e alt_name" - err.append({'class': 9018031, 'subclass': 23034604, 'text': mapcss.tr(u'nome utilizado de forma incorreta')}) + err.append({'class': 9018031, 'subclass': 115703372, 'text': mapcss.tr(u'nome utilizado de forma incorreta')}) - # relation[boundary][type!=boundary] + # relation[boundary][type!=boundary][inside("BR")] if (u'boundary' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') and mapcss._tag_capture(capture_tags, 1, tags, u'type') != mapcss._value_capture(capture_tags, 1, u'boundary')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') and mapcss._tag_capture(capture_tags, 1, tags, u'type') != mapcss._value_capture(capture_tags, 1, u'boundary') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir ''type=boundary''","{0.key}") - err.append({'class': 9018048, 'subclass': 404484969, 'text': mapcss.tr(u'{0} deve possuir \'\'type=boundary\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018048, 'subclass': 1926430386, 'text': mapcss.tr(u'{0} deve possuir \'\'type=boundary\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # relation[type=boundary][!boundary] + # relation[type=boundary][!boundary][inside("BR")] if (u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'boundary') and not mapcss._tag_capture(capture_tags, 1, tags, u'boundary')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'boundary') and not mapcss._tag_capture(capture_tags, 1, tags, u'boundary') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser utilizado junto com {1}","{0.tag}","{1.key}") - err.append({'class': 9018049, 'subclass': 919335957, 'text': mapcss.tr(u'{0} deve ser utilizado junto com {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018049, 'subclass': 1270177491, 'text': mapcss.tr(u'{0} deve ser utilizado junto com {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # relation[admin_level][boundary!=administrative] + # relation[admin_level][boundary!=administrative][inside("BR")] if (u'admin_level' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'admin_level') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'administrative')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'admin_level') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'administrative') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwError:tr("ausência de boundary=administrative") # fixAdd:"boundary=administrative" - err.append({'class': 9018006, 'subclass': 585818652, 'text': mapcss.tr(u'ausência de boundary=administrative'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 1136060061, 'text': mapcss.tr(u'ausência de boundary=administrative'), 'allow_fix_override': True, 'fix': { '+': dict([ [u'boundary',u'administrative']]) }}) - # relation[boundary=administrative][!admin_level] + # relation[boundary=administrative][!admin_level][inside("BR")] if (u'boundary' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'administrative') and not mapcss._tag_capture(capture_tags, 1, tags, u'admin_level')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'administrative') and not mapcss._tag_capture(capture_tags, 1, tags, u'admin_level') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 1254141393, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 802276360, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # relation[place][place!~/^(city_block|farm|hamlet|island|islet|isolated_dwelling|neighbourhood|square)$/][!admin_level][!boundary] + # relation[place][place!~/^(city_block|farm|hamlet|island|islet|isolated_dwelling|neighbourhood|square)$/][!admin_level][!boundary][inside("BR")] if (u'place' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_58f616c9), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and not mapcss._tag_capture(capture_tags, 2, tags, u'admin_level') and not mapcss._tag_capture(capture_tags, 3, tags, u'boundary')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_58f616c9), mapcss._tag_capture(capture_tags, 1, tags, u'place')) and not mapcss._tag_capture(capture_tags, 2, tags, u'admin_level') and not mapcss._tag_capture(capture_tags, 3, tags, u'boundary') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("local com ausência/incoerência de limite administrativo") - err.append({'class': 9018002, 'subclass': 1798440430, 'text': mapcss.tr(u'local com ausência/incoerência de limite administrativo')}) + err.append({'class': 9018002, 'subclass': 1689081650, 'text': mapcss.tr(u'local com ausência/incoerência de limite administrativo')}) - # relation[boundary=administrative][type=multipolygon] + # relation[boundary=administrative][type=multipolygon][inside("BR")] if (u'boundary' in keys and u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'administrative') and mapcss._tag_capture(capture_tags, 1, tags, u'type') == mapcss._value_capture(capture_tags, 1, u'multipolygon')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'administrative') and mapcss._tag_capture(capture_tags, 1, tags, u'type') == mapcss._value_capture(capture_tags, 1, u'multipolygon') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwError:tr("relação deve ser do tipo ''type=boundary''") # fixAdd:"type=boundary" - err.append({'class': 9018006, 'subclass': 150723186, 'text': mapcss.tr(u'relação deve ser do tipo \'\'type=boundary\'\''), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 238210452, 'text': mapcss.tr(u'relação deve ser do tipo \'\'type=boundary\'\''), 'allow_fix_override': True, 'fix': { '+': dict([ [u'type',u'boundary']]) }}) - # *[boundary=national_park][!name] - # *[boundary=protected_area][!name] - # *[leisure=nature_reserve][!name] + # *[boundary=national_park][!name][inside("BR")] + # *[boundary=protected_area][!name][inside("BR")] + # *[leisure=nature_reserve][!name][inside("BR")] if (u'boundary' in keys) or (u'leisure' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'national_park') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'national_park') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 1492609299, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 1196875584, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[boundary=protected_area][!protect_class] + # *[boundary=protected_area][!protect_class][inside("BR")] if (u'boundary' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'protect_class')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'boundary') == mapcss._value_capture(capture_tags, 0, u'protected_area') and not mapcss._tag_capture(capture_tags, 1, tags, u'protect_class') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve possuir {1}","{0.tag}","{1.key}") - err.append({'class': 9018033, 'subclass': 822952800, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018033, 'subclass': 1593244126, 'text': mapcss.tr(u'{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[protect_class][protect_class!~/^(1(a|b)?|[1-9][0-9]?)$/] + # *[protect_class][protect_class!~/^(1(a|b)?|[1-9][0-9]?)$/][inside("BR")] if (u'protect_class' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5ac7053e), mapcss._tag_capture(capture_tags, 1, tags, u'protect_class'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5ac7053e), mapcss._tag_capture(capture_tags, 1, tags, u'protect_class')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("valor incorreto para {0}","{0.key}") - err.append({'class': 9018034, 'subclass': 1459161459, 'text': mapcss.tr(u'valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018034, 'subclass': 1183781531, 'text': mapcss.tr(u'valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[protect_class][boundary!=protected_area] + # *[protect_class][boundary!=protected_area][inside("BR")] if (u'protect_class' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'protected_area')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'protect_class') and mapcss._tag_capture(capture_tags, 1, tags, u'boundary') != mapcss._value_capture(capture_tags, 1, u'protected_area') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("ausência de boundary=protected_area") - err.append({'class': 9018035, 'subclass': 1208814760, 'text': mapcss.tr(u'ausência de boundary=protected_area')}) + err.append({'class': 9018035, 'subclass': 1649283274, 'text': mapcss.tr(u'ausência de boundary=protected_area')}) - # relation[destination][type!=waterway] + # relation[destination][type!=waterway][inside("BR")] if (u'destination' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'destination') and mapcss._tag_capture(capture_tags, 1, tags, u'type') != mapcss._value_capture(capture_tags, 1, u'waterway')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'destination') and mapcss._tag_capture(capture_tags, 1, tags, u'type') != mapcss._value_capture(capture_tags, 1, u'waterway') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} deve ser usado apenas em ways","{0.key}") - err.append({'class': 9018036, 'subclass': 1752813638, 'text': mapcss.tr(u'{0} deve ser usado apenas em ways', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018036, 'subclass': 1899110172, 'text': mapcss.tr(u'{0} deve ser usado apenas em ways', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name=~/.* D(a|e|o)s? .*/] + # *[name=~/.* D(a|e|o)s? .*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2ffc377d), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2ffc377d), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("''da'', ''de'' e ''do'' são minúsculos nos nomes em português") - err.append({'class': 9018002, 'subclass': 1986668346, 'text': mapcss.tr(u'\'\'da\'\', \'\'de\'\' e \'\'do\'\' são minúsculos nos nomes em português')}) + err.append({'class': 9018002, 'subclass': 874509528, 'text': mapcss.tr(u'\'\'da\'\', \'\'de\'\' e \'\'do\'\' são minúsculos nos nomes em português')}) - # *[name=~/^[a-z].*/] + # *[name=~/^[a-z].*/][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_39d67968), mapcss._tag_capture(capture_tags, 0, tags, u'name'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_39d67968), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("nome iniciando com letra minúscula") - err.append({'class': 9018002, 'subclass': 167462302, 'text': mapcss.tr(u'nome iniciando com letra minúscula')}) + err.append({'class': 9018002, 'subclass': 2073274467, 'text': mapcss.tr(u'nome iniciando com letra minúscula')}) - # *[alt_ref] + # *[alt_ref][inside("BR")] if (u'alt_ref' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_ref')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'alt_ref') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("o conteúdo de {0} deve fazer parte de ref, separado por ;","{0.key}") # suggestAlternative:"ref" - err.append({'class': 9018039, 'subclass': 722411109, 'text': mapcss.tr(u'o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018039, 'subclass': 836388143, 'text': mapcss.tr(u'o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[surface][eval(number_of_tags())=1] + # *[surface][eval(number_of_tags())=1][inside("BR")] if (u'surface' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'surface') and len(tags) == 1) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'surface') and len(tags) == 1 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto incompleto: possui apenas {0}","{0.key}") - err.append({'class': 9018041, 'subclass': 1776991136, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018041, 'subclass': 411244066, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *[name][surface][eval(number_of_tags())=2] - # *[name][website][eval(number_of_tags())=2] + # *[name][surface][eval(number_of_tags())=2][inside("BR")] + # *[name][website][eval(number_of_tags())=2][inside("BR")] if (u'name' in keys and u'surface' in keys) or (u'name' in keys and u'website' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and len(tags) == 2) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and len(tags) == 2 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'website') and len(tags) == 2) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss._tag_capture(capture_tags, 1, tags, u'website') and len(tags) == 2 and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("objeto incompleto: possui apenas {0} e {1}","{0.key}","{1.key}") - err.append({'class': 9018042, 'subclass': 626126700, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9018042, 'subclass': 585137381, 'text': mapcss.tr(u'objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) - # *[leisure=pitch][sport=tennis][surface=unpaved] + # *[leisure=pitch][sport=tennis][surface=unpaved][inside("BR")] if (u'leisure' in keys and u'sport' in keys and u'surface' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'pitch') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') == mapcss._value_capture(capture_tags, 1, u'tennis') and mapcss._tag_capture(capture_tags, 2, tags, u'surface') == mapcss._value_capture(capture_tags, 2, u'unpaved')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'pitch') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') == mapcss._value_capture(capture_tags, 1, u'tennis') and mapcss._tag_capture(capture_tags, 2, tags, u'surface') == mapcss._value_capture(capture_tags, 2, u'unpaved') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") # throwWarning:tr("{0} com superfície incorreta","{2.key}") # suggestAlternative:"surface=clay" # fixAdd:"surface=clay" - err.append({'class': 9018006, 'subclass': 1659179489, 'text': mapcss.tr(u'{0} com superfície incorreta', mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 990400213, 'text': mapcss.tr(u'{0} com superfície incorreta', mapcss._tag_uncapture(capture_tags, u'{2.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'surface',u'clay']]) }}) - # *[amenity=fuel][name=~/(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b/] + # *[amenity=fuel][name=~/(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_604bb645), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_604bb645), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("o nome não deve conter a bandeira/marca do posto") + # suggestAlternative:"brand" + err.append({'class': 9018002, 'subclass': 1724035987, 'text': mapcss.tr(u'o nome não deve conter a bandeira/marca do posto')}) + + # *[amenity=fuel][brand=BR][inside("BR")] + if (u'amenity' in keys and u'brand' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fuel') and mapcss._tag_capture(capture_tags, 1, tags, u'brand') == mapcss._value_capture(capture_tags, 1, u'BR') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("uso inconsistente de bandeira do posto") + # suggestAlternative:"brand=Petrobras" + # fixAdd:"brand=Petrobras" + err.append({'class': 9018002, 'subclass': 435141543, 'text': mapcss.tr(u'uso inconsistente de bandeira do posto'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'brand',u'Petrobras']]) + }}) + + # *[shop=gas][name=~/(?i)(?u)^(Brasilg(á|a)s|Consigaz|Copagaz|Liquig(á|a)s|Minasg(á|a)s|Nacional G(á|a)s|Supergasbras|Ultragaz)$/][inside("BR")] + if (u'name' in keys and u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'gas') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_31732cd0), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") - # throwWarning:tr("uso incorreto da bandeira do posto") + # throwWarning:tr("o nome não deve conter a bandeira/marca da loja") # suggestAlternative:"brand" - err.append({'class': 9018002, 'subclass': 935774110, 'text': mapcss.tr(u'uso incorreto da bandeira do posto')}) + err.append({'class': 9018002, 'subclass': 867102166, 'text': mapcss.tr(u'o nome não deve conter a bandeira/marca da loja')}) - # *[/_[0-9]$/][!"is_in:iso_3166_2"] + # *[/_[0-9]$/][!"is_in:iso_3166_2"][inside("BR")] if True: match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_57b8ef8e) and not mapcss._tag_capture(capture_tags, 1, tags, u'is_in:iso_3166_2')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_57b8ef8e) and not mapcss._tag_capture(capture_tags, 1, tags, u'is_in:iso_3166_2') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("chave inválida: {0}","{0.key}") - err.append({'class': 9018022, 'subclass': 331369569, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9018022, 'subclass': 231229079, 'text': mapcss.tr(u'chave inválida: {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) - # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][!note] + # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][!note][inside("BR")] if (u'addr:housenumber' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and not mapcss._tag_capture(capture_tags, 1, tags, u'note')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and not mapcss._tag_capture(capture_tags, 1, tags, u'note') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Correções e melhorias") @@ -3804,115 +4287,266 @@ def relation(self, data, tags, members): # suggestAlternative:"note" # fixRemove:"addr:housenumber" # fixAdd:"note=Local sem número" - err.append({'class': 9018006, 'subclass': 931902546, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9018006, 'subclass': 630415638, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'note',u'Local sem número']]), '-': ([ u'addr:housenumber']) }}) - # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][note] + # *["addr:housenumber"=~/(?i)^s(\.|-| )?\/?n\.?º?$/][note][inside("BR")] if (u'addr:housenumber' in keys and u'note' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and mapcss._tag_capture(capture_tags, 1, tags, u'note')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_0b27200b), mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber')) and mapcss._tag_capture(capture_tags, 1, tags, u'note') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwWarning:tr("não utilizar ''{0}'' para locais sem número",tag("addr:housenumber")) # suggestAlternative:"note" - err.append({'class': 9018043, 'subclass': 1717284811, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber'))}) + err.append({'class': 9018043, 'subclass': 1150070765, 'text': mapcss.tr(u'não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, u'addr:housenumber'))}) - # *[source=~/(?i)google/] + # *[source=~/(?i)google/][inside("BR")] if (u'source' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2e8e4f2b), mapcss._tag_capture(capture_tags, 0, tags, u'source'))) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_2e8e4f2b), mapcss._tag_capture(capture_tags, 0, tags, u'source')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # throwError:tr("objeto contém Google como source") - err.append({'class': 9018044, 'subclass': 1313403884, 'text': mapcss.tr(u'objeto contém Google como source')}) + err.append({'class': 9018044, 'subclass': 1159310436, 'text': mapcss.tr(u'objeto contém Google como source')}) - # *[amenity=townhall][name=~/^(?i)(?u)c(â|a)mara\b/] + # *[amenity=townhall][name=~/^(?i)(?u)c(â|a)mara\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("câmara de vereadores mapeada incorretamente") # suggestAlternative:"office=government + government=legislative" - err.append({'class': 9018002, 'subclass': 129695507, 'text': mapcss.tr(u'câmara de vereadores mapeada incorretamente')}) + err.append({'class': 9018002, 'subclass': 532372413, 'text': mapcss.tr(u'câmara de vereadores mapeada incorretamente')}) - # *[office=government][government!=legislative][name=~/^(?i)(?u)c(â|a)mara\b/] + # *[office=government][government!=legislative][name=~/^(?i)(?u)c(â|a)mara\b/][inside("BR")] if (u'name' in keys and u'office' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss._tag_capture(capture_tags, 1, tags, u'government') != mapcss._value_capture(capture_tags, 1, u'legislative') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 2, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss._tag_capture(capture_tags, 1, tags, u'government') != mapcss._value_capture(capture_tags, 1, u'legislative') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_46ab4d8d), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("ausência de government=legislative") - err.append({'class': 9018002, 'subclass': 869412796, 'text': mapcss.tr(u'ausência de government=legislative')}) + err.append({'class': 9018002, 'subclass': 2126685099, 'text': mapcss.tr(u'ausência de government=legislative')}) - # *[amenity=townhall][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/] - # *[office=government][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/] + # *[amenity=townhall][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/][inside("BR")] + # *[office=government][name=~/^(?i)(?u)c((â|a)me|ama)ra\b/][inside("BR")] if (u'amenity' in keys and u'name' in keys) or (u'name' in keys and u'office' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'townhall') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'office') == mapcss._value_capture(capture_tags, 0, u'government') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_793b22ec), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("erro de ortografia em ''câmara''") - err.append({'class': 9018002, 'subclass': 212328084, 'text': mapcss.tr(u'erro de ortografia em \'\'câmara\'\'')}) + err.append({'class': 9018002, 'subclass': 1277153079, 'text': mapcss.tr(u'erro de ortografia em \'\'câmara\'\'')}) + + # *[name=~/(?i)^prefeitura\b/][amenity!=townhall][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7ec1fb9a), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'townhall') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("prefeitura possivelmente mapeada de forma incorreta") + # suggestAlternative:"amenity=townhall" + err.append({'class': 9018002, 'subclass': 1445137044, 'text': mapcss.tr(u'prefeitura possivelmente mapeada de forma incorreta')}) - # *[amenity=charging_station] + # *[name=~/(?i)(?u)^paço\b/][amenity!=townhall][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_13f4c147), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'townhall') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("paço possivelmente mapeado de forma incorreta") + # suggestAlternative:"amenity=townhall" + err.append({'class': 9018002, 'subclass': 1169494638, 'text': mapcss.tr(u'paço possivelmente mapeado de forma incorreta')}) + + # *[amenity=charging_station][inside("BR")] if (u'amenity' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'charging_station')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'charging_station') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("possivelmente deve ser amenity=fuel") - err.append({'class': 9018002, 'subclass': 128902291, 'text': mapcss.tr(u'possivelmente deve ser amenity=fuel')}) + err.append({'class': 9018002, 'subclass': 2011797637, 'text': mapcss.tr(u'possivelmente deve ser amenity=fuel')}) - # *[name=~/(?i)^Borrach(aria|eiro)/][shop=tyres][!repair] + # *[name=~/(?i)^Borrach(aria|eiro)/][shop=tyres][!repair][inside("BR")] if (u'name' in keys and u'shop' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') == mapcss._value_capture(capture_tags, 1, u'tyres') and not mapcss._tag_capture(capture_tags, 2, tags, u'repair')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') == mapcss._value_capture(capture_tags, 1, u'tyres') and not mapcss._tag_capture(capture_tags, 2, tags, u'repair') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("borracharia sem ''repair=yes''") # suggestAlternative:"repair=yes" - err.append({'class': 9018002, 'subclass': 817061630, 'text': mapcss.tr(u'borracharia sem \'\'repair=yes\'\'')}) + err.append({'class': 9018002, 'subclass': 1225518759, 'text': mapcss.tr(u'borracharia sem \'\'repair=yes\'\'')}) - # *[name=~/(?i)^Borrach(aria|eiro)/][shop!=tyres] + # *[name=~/(?i)^Borrach(aria|eiro)/][shop!=tyres][inside("BR")] if (u'name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') != mapcss._value_capture(capture_tags, 1, u'tyres')) + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_126ba9a9), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'shop') != mapcss._value_capture(capture_tags, 1, u'tyres') and mapcss.inside(self.father.config.options, u'BR')) except mapcss.RuleAbort: pass if match: # group:tr("Brasil - Verificar") # throwWarning:tr("borracharia sem ''shop=tyres''") # suggestAlternative:"shop=tyres" - err.append({'class': 9018002, 'subclass': 1324999258, 'text': mapcss.tr(u'borracharia sem \'\'shop=tyres\'\'')}) + err.append({'class': 9018002, 'subclass': 755877630, 'text': mapcss.tr(u'borracharia sem \'\'shop=tyres\'\'')}) + + # *[name=~/(?i)\bcoreto\b/][leisure!=bandstand][leisure!=park][inside("BR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_6e34cd0f), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'leisure') != mapcss._value_capture(capture_tags, 1, u'bandstand') and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') != mapcss._value_capture(capture_tags, 2, u'park') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("coreto possivelmente classificado de forma incorreta") + # suggestAlternative:"leisure=bandstand" + err.append({'class': 9018002, 'subclass': 810497942, 'text': mapcss.tr(u'coreto possivelmente classificado de forma incorreta')}) + + # *[leisure=recreation_ground][inside("BR")] + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'recreation_ground') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} impreciso","{0.tag}") + # suggestAlternative:"landuse=recreation_ground" + # suggestAlternative:"leisure=park" + err.append({'class': 9018002, 'subclass': 1594563801, 'text': mapcss.tr(u'{0} impreciso', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[leisure=recreation_ground][landuse=recreation_ground][inside("BR")] + if (u'landuse' in keys and u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'recreation_ground') and mapcss._tag_capture(capture_tags, 1, tags, u'landuse') == mapcss._value_capture(capture_tags, 1, u'recreation_ground') and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} supérfluo","{0.tag}") + # fixRemove:"leisure" + err.append({'class': 9018002, 'subclass': 627419845, 'text': mapcss.tr(u'{0} supérfluo', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'leisure']) + }}) + + # *["ref:vatin"]["ref:vatin"!~/^BR[0-9]{14}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_524288b6), mapcss._tag_capture(capture_tags, 1, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("CNPJ diferente do formato BRxxxxxxxxxxxxxx") + err.append({'class': 9018002, 'subclass': 1793026117, 'text': mapcss.tr(u'CNPJ diferente do formato BRxxxxxxxxxxxxxx')}) + + # *["ref:vatin"=~/^[0-9]{2}\.[0-9]{3}\.[0-9]{3}\/[0-9]{4}-[0-9]{2}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_5ddbb7eb), mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Correções e melhorias") + # throwWarning:tr("formato do CNPJ pode ser melhorado em {0}","{0.key}") + # fixAdd:concat("ref:vatin=BR",replace(replace(replace(tag("ref:vatin"),"/",""),".",""),"-","")) + err.append({'class': 9018006, 'subclass': 1609978963, 'text': mapcss.tr(u'formato do CNPJ pode ser melhorado em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + (mapcss.concat(u'ref:vatin=BR', mapcss.replace(mapcss.replace(mapcss.replace(mapcss.tag(tags, u'ref:vatin'), u'/', u''), u'.', u''), u'-', u''))).split('=', 1)]) + }}) + + # *["ref:vatin"=~/^(br|bR|Br)[0-9]{14}$/][inside("BR")] + if (u'ref:vatin' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_408831d0), mapcss._tag_capture(capture_tags, 0, tags, u'ref:vatin')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Correções e melhorias") + # throwWarning:tr("CNPJ deve iniciar maiúsculo: BRxxxxxxxxxxxxxx") + # fixAdd:concat("ref:vatin=",upper(tag("ref:vatin"))) + err.append({'class': 9018006, 'subclass': 1616044431, 'text': mapcss.tr(u'CNPJ deve iniciar maiúsculo: BRxxxxxxxxxxxxxx'), 'allow_fix_override': True, 'fix': { + '+': dict([ + (mapcss.concat(u'ref:vatin=', mapcss.upper(mapcss.tag(tags, u'ref:vatin')))).split('=', 1)]) + }}) + + # *[phone][phone!~/^(\+55|0800)/][inside("BR")] + # *["contact:phone"]["contact:phone"!~/^(\+55|0800)/][inside("BR")] + if (u'contact:phone' in keys) or (u'phone' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'phone') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_243f4993), mapcss._tag_capture(capture_tags, 1, tags, u'phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'contact:phone') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_243f4993), mapcss._tag_capture(capture_tags, 1, tags, u'contact:phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("{0} em formato diferente do internacional +55 XX YYYY-YYYY","{0.key}") + err.append({'class': 9018002, 'subclass': 1438682200, 'text': mapcss.tr(u'{0} em formato diferente do internacional +55 XX YYYY-YYYY', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + + # *[phone=~/^(100|18{0,1}|19[0-9])$/][inside("BR")] + # *["contact:phone"=~/^(100|18{0,1}|19[0-9])$/][inside("BR")] + if (u'contact:phone' in keys) or (u'phone' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7a246e93), mapcss._tag_capture(capture_tags, 0, tags, u'phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_7a246e93), mapcss._tag_capture(capture_tags, 0, tags, u'contact:phone')) and mapcss.inside(self.father.config.options, u'BR')) + except mapcss.RuleAbort: pass + if match: + # group:tr("Brasil - Verificar") + # throwWarning:tr("não usar número de emergência em {0}","{0.key}") + # fixRemove:"{0.key}" + err.append({'class': 9018002, 'subclass': 371146161, 'text': mapcss.tr(u'não usar número de emergência em {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) return err diff --git a/plugins/Josm_combinations.py b/plugins/Josm_combinations.py index 2c4586499..206c64c4e 100644 --- a/plugins/Josm_combinations.py +++ b/plugins/Josm_combinations.py @@ -47,6 +47,7 @@ def node(self, data, tags): # node[ntd_id][!highway] # *[border_type][!boundary] # *[piste:difficulty][!piste:type] + # *[place][!name][place!=islet] # *[source:date][!source] # *[source:name][!name] # *[source:maxspeed:forward][!maxspeed:forward][!maxspeed] @@ -74,7 +75,7 @@ def node(self, data, tags): # *[source:addr:housenumber][!addr:housenumber] # *[source:addr][!/^addr:/] # *[source:maxspeed][!/^maxspeed:?/] - if (u'border_type' in keys) or (u'ntd_id' in keys) or (u'piste:difficulty' in keys) or (u'source:addr' in keys) or (u'source:addr:housenumber' in keys) or (u'source:addr:postcode' in keys) or (u'source:bicycle' in keys) or (u'source:bridge' in keys) or (u'source:building' in keys) or (u'source:date' in keys) or (u'source:designation' in keys) or (u'source:ele' in keys) or (u'source:height' in keys) or (u'source:hgv' in keys) or (u'source:highway' in keys) or (u'source:housenumber' in keys) or (u'source:lanes' in keys) or (u'source:lit' in keys) or (u'source:maxaxleload' in keys) or (u'source:maxspeed' in keys) or (u'source:maxspeed:backward' in keys) or (u'source:maxspeed:forward' in keys) or (u'source:name' in keys) or (u'source:old_name' in keys) or (u'source:population' in keys) or (u'source:postal_code' in keys) or (u'source:postcode' in keys) or (u'source:ref' in keys) or (u'source:ref:INSEE' in keys) or (u'source:surface' in keys): + if (u'border_type' in keys) or (u'ntd_id' in keys) or (u'piste:difficulty' in keys) or (u'place' in keys) or (u'source:addr' in keys) or (u'source:addr:housenumber' in keys) or (u'source:addr:postcode' in keys) or (u'source:bicycle' in keys) or (u'source:bridge' in keys) or (u'source:building' in keys) or (u'source:date' in keys) or (u'source:designation' in keys) or (u'source:ele' in keys) or (u'source:height' in keys) or (u'source:hgv' in keys) or (u'source:highway' in keys) or (u'source:housenumber' in keys) or (u'source:lanes' in keys) or (u'source:lit' in keys) or (u'source:maxaxleload' in keys) or (u'source:maxspeed' in keys) or (u'source:maxspeed:backward' in keys) or (u'source:maxspeed:forward' in keys) or (u'source:name' in keys) or (u'source:old_name' in keys) or (u'source:population' in keys) or (u'source:postal_code' in keys) or (u'source:postcode' in keys) or (u'source:ref' in keys) or (u'source:ref:INSEE' in keys) or (u'source:surface' in keys): match = False if not match: capture_tags = {} @@ -88,6 +89,10 @@ def node(self, data, tags): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'piste:difficulty') and not mapcss._tag_capture(capture_tags, 1, tags, u'piste:type')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss._tag_capture(capture_tags, 2, tags, u'place') != mapcss._value_capture(capture_tags, 2, u'islet')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source:date') and not mapcss._tag_capture(capture_tags, 1, tags, u'source')) @@ -202,8 +207,9 @@ def node(self, data, tags): # assertMatch:"node source:addr:postcode=postman" # assertNoMatch:"node source:addr=postman addr:housenumber=42" # assertMatch:"node source:addr=postman" - err.append({'class': 9001001, 'subclass': 1812055539, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001001, 'subclass': 1008153779, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # node[fire_hydrant:type][emergency!=fire_hydrant][disused:emergency!=fire_hydrant] # *[transformer][!power] # *[recycling_type][amenity!=recycling] # *[information][tourism!=information] @@ -216,8 +222,12 @@ def node(self, data, tags): # *[castle_type][historic!=castle] # *[parking][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking)$/] # *[bunker_type][military!=bunker] - if (u'artwork_type' in keys) or (u'board_type' in keys) or (u'bunker_type' in keys) or (u'castle_type' in keys) or (u'information' in keys) or (u'lamp_type' in keys) or (u'map_type' in keys) or (u'parking' in keys) or (u'recycling_type' in keys) or (u'shelter_type' in keys) or (u'site_type' in keys) or (u'transformer' in keys): + if (u'artwork_type' in keys) or (u'board_type' in keys) or (u'bunker_type' in keys) or (u'castle_type' in keys) or (u'fire_hydrant:type' in keys) or (u'information' in keys) or (u'lamp_type' in keys) or (u'map_type' in keys) or (u'parking' in keys) or (u'recycling_type' in keys) or (u'shelter_type' in keys) or (u'site_type' in keys) or (u'transformer' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'fire_hydrant:type') and mapcss._tag_capture(capture_tags, 1, tags, u'emergency') != mapcss._value_capture(capture_tags, 1, u'fire_hydrant') and mapcss._tag_capture(capture_tags, 2, tags, u'disused:emergency') != mapcss._value_capture(capture_tags, 2, u'fire_hydrant')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'transformer') and not mapcss._tag_capture(capture_tags, 1, tags, u'power')) @@ -269,7 +279,7 @@ def node(self, data, tags): if match: # group:tr("missing tag") # throwWarning:tr("{0} without {1}","{0.key}","{1.tag}") - err.append({'class': 9001001, 'subclass': 1621799652, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + err.append({'class': 9001001, 'subclass': 880056674, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) # *[bridge:movable][bridge!=movable][man_made!=bridge] # *[substation][power!=substation][pipeline!=substation] @@ -293,14 +303,19 @@ def node(self, data, tags): # throwWarning:tr("{0} without {1} or {2}","{0.key}","{1.tag}","{2.tag}") err.append({'class': 9001001, 'subclass': 1195794842, 'text': mapcss.tr(u'{0} without {1} or {2}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'), mapcss._tag_uncapture(capture_tags, u'{2.tag}'))}) + # node[emergency=fire_hydrant][!fire_hydrant:type] # *[tourism=information][!information] # *[leisure=pitch][!sport] # *[aeroway=terminal][!building] # *[power=generator][!generator:source] # *[amenity=social_facility][!social_facility] # *[amenity=place_of_worship][!religion] - if (u'aeroway' in keys) or (u'amenity' in keys) or (u'leisure' in keys) or (u'power' in keys) or (u'tourism' in keys): + if (u'aeroway' in keys) or (u'amenity' in keys) or (u'emergency' in keys) or (u'leisure' in keys) or (u'power' in keys) or (u'tourism' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'fire_hydrant') and not mapcss._tag_capture(capture_tags, 1, tags, u'fire_hydrant:type')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tourism') == mapcss._value_capture(capture_tags, 0, u'information') and not mapcss._tag_capture(capture_tags, 1, tags, u'information')) @@ -328,7 +343,7 @@ def node(self, data, tags): if match: # group:tr("missing tag") # throwWarning:tr("{0} without {1}","{0.tag}","{1.key}") - err.append({'class': 9001001, 'subclass': 288794802, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001001, 'subclass': 1599415806, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # *[smoothness][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/] # *[segregated][!highway][railway!=crossing] @@ -595,12 +610,12 @@ def node(self, data, tags): u'natural']) }}) - # *[sport][sport!=skiing][!building][!club][tourism!=hotel][highway!=raceway][!leisure][natural!~/^(beach|bare_rock|cliff|peak|water)$/][amenity!~/^(pub|restaurant|swimming_pool)$/][landuse!~/^(recreation_ground|piste|farm|farmland)$/][barrier!~/^(wall|retaining_wall)$/][!"piste:type"][shop!=sports] + # *[sport][sport!=skiing][!building][!club][tourism!=hotel][highway!=raceway][!leisure][natural!~/^(beach|bare_rock|cliff|peak|water)$/][amenity!~/^(pub|restaurant|swimming_pool)$/][landuse!~/^(recreation_ground|piste|farm|farmland)$/][barrier!~/^(wall|retaining_wall)$/][!"piste:type"][shop!=sports][attraction!=summer_toboggan] if (u'sport' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') != mapcss._value_capture(capture_tags, 1, u'skiing') and not mapcss._tag_capture(capture_tags, 2, tags, u'building') and not mapcss._tag_capture(capture_tags, 3, tags, u'club') and mapcss._tag_capture(capture_tags, 4, tags, u'tourism') != mapcss._value_capture(capture_tags, 4, u'hotel') and mapcss._tag_capture(capture_tags, 5, tags, u'highway') != mapcss._value_capture(capture_tags, 5, u'raceway') and not mapcss._tag_capture(capture_tags, 6, tags, u'leisure') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 7, self.re_29fa4401), mapcss._tag_capture(capture_tags, 7, tags, u'natural')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 8, self.re_64c931ef), mapcss._tag_capture(capture_tags, 8, tags, u'amenity')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 9, self.re_3b4f8f73), mapcss._tag_capture(capture_tags, 9, tags, u'landuse')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 10, self.re_68c05e86), mapcss._tag_capture(capture_tags, 10, tags, u'barrier')) and not mapcss._tag_capture(capture_tags, 11, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 12, tags, u'shop') != mapcss._value_capture(capture_tags, 12, u'sports')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') != mapcss._value_capture(capture_tags, 1, u'skiing') and not mapcss._tag_capture(capture_tags, 2, tags, u'building') and not mapcss._tag_capture(capture_tags, 3, tags, u'club') and mapcss._tag_capture(capture_tags, 4, tags, u'tourism') != mapcss._value_capture(capture_tags, 4, u'hotel') and mapcss._tag_capture(capture_tags, 5, tags, u'highway') != mapcss._value_capture(capture_tags, 5, u'raceway') and not mapcss._tag_capture(capture_tags, 6, tags, u'leisure') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 7, self.re_29fa4401), mapcss._tag_capture(capture_tags, 7, tags, u'natural')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 8, self.re_64c931ef), mapcss._tag_capture(capture_tags, 8, tags, u'amenity')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 9, self.re_3b4f8f73), mapcss._tag_capture(capture_tags, 9, tags, u'landuse')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 10, self.re_68c05e86), mapcss._tag_capture(capture_tags, 10, tags, u'barrier')) and not mapcss._tag_capture(capture_tags, 11, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 12, tags, u'shop') != mapcss._value_capture(capture_tags, 12, u'sports') and mapcss._tag_capture(capture_tags, 13, tags, u'attraction') != mapcss._value_capture(capture_tags, 13, u'summer_toboggan')) except mapcss.RuleAbort: pass if match: # group:tr("missing tag") @@ -611,7 +626,7 @@ def node(self, data, tags): # assertNoMatch:"node sport=swimming tourism=hotel" # assertNoMatch:"node sport=tennis leisure=pitch" # assertMatch:"node sport=tennis" - err.append({'class': 9001001, 'subclass': 1531133249, 'text': mapcss.tr(u'sport without physical feature')}) + err.append({'class': 9001001, 'subclass': 1631566710, 'text': mapcss.tr(u'sport without physical feature')}) # *[building:levels][!building][!building:part] if (u'building:levels' in keys): @@ -694,6 +709,22 @@ def node(self, data, tags): u'male']) }}) + # node[leisure=park][natural=tree] + if (u'leisure' in keys and u'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'park') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') == mapcss._value_capture(capture_tags, 1, u'tree')) + except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwWarning:tr("{0} together with {1} on a node. Remove {0}.","{0.tag}","{1.tag}") + # fixRemove:"leisure" + err.append({'class': 9001002, 'subclass': 1715941543, 'text': mapcss.tr(u'{0} together with {1} on a node. Remove {0}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'leisure']) + }}) + return err def way(self, data, tags, nds): @@ -739,6 +770,7 @@ def way(self, data, tags, nds): # way[have_riverbank][!waterway] # *[border_type][!boundary] # *[piste:difficulty][!piste:type] + # *[place][!name][place!=islet] # *[source:date][!source] # *[source:name][!name] # *[source:maxspeed:forward][!maxspeed:forward][!maxspeed] @@ -766,7 +798,7 @@ def way(self, data, tags, nds): # *[source:addr:housenumber][!addr:housenumber] # *[source:addr][!/^addr:/] # *[source:maxspeed][!/^maxspeed:?/] - if (u'border_type' in keys) or (u'canal' in keys) or (u'detail' in keys) or (u'eddy_current_brake' in keys) or (u'electrified' in keys) or (u'etcs' in keys) or (u'gauge' in keys) or (u'grade_of_track' in keys) or (u'have_riverbank' in keys) or (u'junction' in keys) or (u'kursbuchstrecke' in keys) or (u'lanes' in keys) or (u'length_unit' in keys) or (u'living_street' in keys) or (u'lzb' in keys) or (u'maintenance' in keys) or (u'median' in keys) or (u'motorroad' in keys) or (u'old_railway_operator' in keys) or (u'operating_procedure' in keys) or (u'piste:difficulty' in keys) or (u'pzb' in keys) or (u'sac_scale' in keys) or (u'sidewalk' in keys) or (u'source:addr' in keys) or (u'source:addr:housenumber' in keys) or (u'source:addr:postcode' in keys) or (u'source:bicycle' in keys) or (u'source:bridge' in keys) or (u'source:building' in keys) or (u'source:date' in keys) or (u'source:designation' in keys) or (u'source:ele' in keys) or (u'source:height' in keys) or (u'source:hgv' in keys) or (u'source:highway' in keys) or (u'source:housenumber' in keys) or (u'source:lanes' in keys) or (u'source:lit' in keys) or (u'source:maxaxleload' in keys) or (u'source:maxspeed' in keys) or (u'source:maxspeed:backward' in keys) or (u'source:maxspeed:forward' in keys) or (u'source:name' in keys) or (u'source:old_name' in keys) or (u'source:population' in keys) or (u'source:postal_code' in keys) or (u'source:postcode' in keys) or (u'source:ref' in keys) or (u'source:ref:INSEE' in keys) or (u'source:surface' in keys) or (u'step_count' in keys) or (u'stream' in keys) or (u'structure_gauge' in keys) or (u'tilting_technology' in keys) or (u'track_class' in keys) or (u'tracks' in keys) or (u'tracktype' in keys) or (u'traffic_mode' in keys) or (u'trail_visibility' in keys) or (u'trolley_wire' in keys) or (u'workrules' in keys) or (u'zip_left' in keys) or (u'zip_right' in keys): + if (u'border_type' in keys) or (u'canal' in keys) or (u'detail' in keys) or (u'eddy_current_brake' in keys) or (u'electrified' in keys) or (u'etcs' in keys) or (u'gauge' in keys) or (u'grade_of_track' in keys) or (u'have_riverbank' in keys) or (u'junction' in keys) or (u'kursbuchstrecke' in keys) or (u'lanes' in keys) or (u'length_unit' in keys) or (u'living_street' in keys) or (u'lzb' in keys) or (u'maintenance' in keys) or (u'median' in keys) or (u'motorroad' in keys) or (u'old_railway_operator' in keys) or (u'operating_procedure' in keys) or (u'piste:difficulty' in keys) or (u'place' in keys) or (u'pzb' in keys) or (u'sac_scale' in keys) or (u'sidewalk' in keys) or (u'source:addr' in keys) or (u'source:addr:housenumber' in keys) or (u'source:addr:postcode' in keys) or (u'source:bicycle' in keys) or (u'source:bridge' in keys) or (u'source:building' in keys) or (u'source:date' in keys) or (u'source:designation' in keys) or (u'source:ele' in keys) or (u'source:height' in keys) or (u'source:hgv' in keys) or (u'source:highway' in keys) or (u'source:housenumber' in keys) or (u'source:lanes' in keys) or (u'source:lit' in keys) or (u'source:maxaxleload' in keys) or (u'source:maxspeed' in keys) or (u'source:maxspeed:backward' in keys) or (u'source:maxspeed:forward' in keys) or (u'source:name' in keys) or (u'source:old_name' in keys) or (u'source:population' in keys) or (u'source:postal_code' in keys) or (u'source:postcode' in keys) or (u'source:ref' in keys) or (u'source:ref:INSEE' in keys) or (u'source:surface' in keys) or (u'step_count' in keys) or (u'stream' in keys) or (u'structure_gauge' in keys) or (u'tilting_technology' in keys) or (u'track_class' in keys) or (u'tracks' in keys) or (u'tracktype' in keys) or (u'traffic_mode' in keys) or (u'trail_visibility' in keys) or (u'trolley_wire' in keys) or (u'workrules' in keys) or (u'zip_left' in keys) or (u'zip_right' in keys): match = False if not match: capture_tags = {} @@ -916,6 +948,10 @@ def way(self, data, tags, nds): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'piste:difficulty') and not mapcss._tag_capture(capture_tags, 1, tags, u'piste:type')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss._tag_capture(capture_tags, 2, tags, u'place') != mapcss._value_capture(capture_tags, 2, u'islet')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source:date') and not mapcss._tag_capture(capture_tags, 1, tags, u'source')) @@ -1029,7 +1065,7 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} without {1}","{0.key}","{1.key}") # assertNoMatch:"way lanes=42 highway=unclassified" # assertMatch:"way lanes=42" - err.append({'class': 9001001, 'subclass': 1275753529, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001001, 'subclass': 2049980645, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # *[transformer][!power] # way[fence_type][barrier!=fence] @@ -1230,13 +1266,13 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} without {1}, {2}, {3} or {4}","{0.key}","{1.key}","{2.tag}","{3.tag}","{4.tag}") err.append({'class': 9001001, 'subclass': 1096267911, 'text': mapcss.tr(u'{0} without {1}, {2}, {3} or {4}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.tag}'), mapcss._tag_uncapture(capture_tags, u'{3.tag}'), mapcss._tag_uncapture(capture_tags, u'{4.tag}'))}) - # way[oneway][!highway][!railway][!aerialway] + # way[oneway][!highway][!railway][!aerialway][attraction!=summer_toboggan] # *[snowplowing][!highway][!amenity][!leisure] if (u'oneway' in keys) or (u'snowplowing' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'oneway') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'aerialway')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'oneway') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'aerialway') and mapcss._tag_capture(capture_tags, 4, tags, u'attraction') != mapcss._value_capture(capture_tags, 4, u'summer_toboggan')) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -1245,15 +1281,15 @@ def way(self, data, tags, nds): if match: # group:tr("missing tag") # throwWarning:tr("{0} without {1}, {2} or {3}","{0.key}","{1.key}","{2.key}","{3.key}") - err.append({'class': 9001001, 'subclass': 1335922311, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.key}'))}) + err.append({'class': 9001001, 'subclass': 1893317839, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.key}'))}) - # way[incline][!highway][!railway][aeroway!~/^(runway|taxiway)$/] + # way[incline][!highway][!railway][aeroway!~/^(runway|taxiway)$/][attraction!=summer_toboggan] # *[toll][!highway][!barrier][route!~/^(ferry|road)$/] if (u'incline' in keys) or (u'toll' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'incline') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_1dcd648f), mapcss._tag_capture(capture_tags, 3, tags, u'aeroway'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'incline') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_1dcd648f), mapcss._tag_capture(capture_tags, 3, tags, u'aeroway')) and mapcss._tag_capture(capture_tags, 4, tags, u'attraction') != mapcss._value_capture(capture_tags, 4, u'summer_toboggan')) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -1262,7 +1298,7 @@ def way(self, data, tags, nds): if match: # group:tr("missing tag") # throwWarning:tr("{0} without {1}, {2} or {3}","{0.key}","{1.key}","{2.key}","{3.tag}") - err.append({'class': 9001001, 'subclass': 413139586, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.tag}'))}) + err.append({'class': 9001001, 'subclass': 1537476943, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.tag}'))}) # *[internet_access=no][internet_access:fee] # *[amenity=vending_machine][shop] @@ -1599,17 +1635,17 @@ def way(self, data, tags, nds): u'natural']) }}) - # *[sport][sport!=skiing][!building][!club][tourism!=hotel][highway!=raceway][!leisure][natural!~/^(beach|bare_rock|cliff|peak|water)$/][amenity!~/^(pub|restaurant|swimming_pool)$/][landuse!~/^(recreation_ground|piste|farm|farmland)$/][barrier!~/^(wall|retaining_wall)$/][!"piste:type"][shop!=sports] + # *[sport][sport!=skiing][!building][!club][tourism!=hotel][highway!=raceway][!leisure][natural!~/^(beach|bare_rock|cliff|peak|water)$/][amenity!~/^(pub|restaurant|swimming_pool)$/][landuse!~/^(recreation_ground|piste|farm|farmland)$/][barrier!~/^(wall|retaining_wall)$/][!"piste:type"][shop!=sports][attraction!=summer_toboggan] if (u'sport' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') != mapcss._value_capture(capture_tags, 1, u'skiing') and not mapcss._tag_capture(capture_tags, 2, tags, u'building') and not mapcss._tag_capture(capture_tags, 3, tags, u'club') and mapcss._tag_capture(capture_tags, 4, tags, u'tourism') != mapcss._value_capture(capture_tags, 4, u'hotel') and mapcss._tag_capture(capture_tags, 5, tags, u'highway') != mapcss._value_capture(capture_tags, 5, u'raceway') and not mapcss._tag_capture(capture_tags, 6, tags, u'leisure') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 7, self.re_29fa4401), mapcss._tag_capture(capture_tags, 7, tags, u'natural')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 8, self.re_64c931ef), mapcss._tag_capture(capture_tags, 8, tags, u'amenity')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 9, self.re_3b4f8f73), mapcss._tag_capture(capture_tags, 9, tags, u'landuse')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 10, self.re_68c05e86), mapcss._tag_capture(capture_tags, 10, tags, u'barrier')) and not mapcss._tag_capture(capture_tags, 11, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 12, tags, u'shop') != mapcss._value_capture(capture_tags, 12, u'sports')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') != mapcss._value_capture(capture_tags, 1, u'skiing') and not mapcss._tag_capture(capture_tags, 2, tags, u'building') and not mapcss._tag_capture(capture_tags, 3, tags, u'club') and mapcss._tag_capture(capture_tags, 4, tags, u'tourism') != mapcss._value_capture(capture_tags, 4, u'hotel') and mapcss._tag_capture(capture_tags, 5, tags, u'highway') != mapcss._value_capture(capture_tags, 5, u'raceway') and not mapcss._tag_capture(capture_tags, 6, tags, u'leisure') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 7, self.re_29fa4401), mapcss._tag_capture(capture_tags, 7, tags, u'natural')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 8, self.re_64c931ef), mapcss._tag_capture(capture_tags, 8, tags, u'amenity')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 9, self.re_3b4f8f73), mapcss._tag_capture(capture_tags, 9, tags, u'landuse')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 10, self.re_68c05e86), mapcss._tag_capture(capture_tags, 10, tags, u'barrier')) and not mapcss._tag_capture(capture_tags, 11, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 12, tags, u'shop') != mapcss._value_capture(capture_tags, 12, u'sports') and mapcss._tag_capture(capture_tags, 13, tags, u'attraction') != mapcss._value_capture(capture_tags, 13, u'summer_toboggan')) except mapcss.RuleAbort: pass if match: # group:tr("missing tag") # throwWarning:tr("sport without physical feature") - err.append({'class': 9001001, 'subclass': 1531133249, 'text': mapcss.tr(u'sport without physical feature')}) + err.append({'class': 9001001, 'subclass': 1631566710, 'text': mapcss.tr(u'sport without physical feature')}) # *[building:levels][!building][!building:part] # way[usage][!railway][!waterway][route!=railway][man_made!=pipeline] @@ -1872,6 +1908,27 @@ def way(self, data, tags, nds): # assertNoMatch:"way highway=primary lanes=4" err.append({'class': 9001001, 'subclass': 841292752, 'text': mapcss.tr(u'street with odd number of {0}, but without {1} and {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.key}'), mapcss._tag_uncapture(capture_tags, u'{4.key}'))}) + # way[highway=pedestrian][width][width<2] + if (u'highway' in keys and u'width' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'pedestrian') and mapcss._tag_capture(capture_tags, 1, tags, u'width') and mapcss._tag_capture(capture_tags, 2, tags, u'width') < mapcss._value_capture(capture_tags, 2, 2)) + except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwWarning:tr("{0} together with {1}","{0.tag}","{1.tag}") + # suggestAlternative:"highway=footway" + # fixAdd:"highway=footway" + # assertMatch:"way highway=pedestrian width=0.8" + # assertMatch:"way highway=pedestrian width=1" + # assertNoMatch:"way highway=pedestrian width=2" + # assertNoMatch:"way highway=pedestrian width=5.5" + err.append({'class': 9001002, 'subclass': 1649889582, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'highway',u'footway']]) + }}) + return err def relation(self, data, tags, members): @@ -1882,6 +1939,7 @@ def relation(self, data, tags, members): # *[border_type][!boundary] # *[piste:difficulty][!piste:type] + # *[place][!name][place!=islet] # *[source:date][!source] # *[source:name][!name] # *[source:maxspeed:forward][!maxspeed:forward][!maxspeed] @@ -1909,7 +1967,7 @@ def relation(self, data, tags, members): # *[source:addr:housenumber][!addr:housenumber] # *[source:addr][!/^addr:/] # *[source:maxspeed][!/^maxspeed:?/] - if (u'border_type' in keys) or (u'piste:difficulty' in keys) or (u'source:addr' in keys) or (u'source:addr:housenumber' in keys) or (u'source:addr:postcode' in keys) or (u'source:bicycle' in keys) or (u'source:bridge' in keys) or (u'source:building' in keys) or (u'source:date' in keys) or (u'source:designation' in keys) or (u'source:ele' in keys) or (u'source:height' in keys) or (u'source:hgv' in keys) or (u'source:highway' in keys) or (u'source:housenumber' in keys) or (u'source:lanes' in keys) or (u'source:lit' in keys) or (u'source:maxaxleload' in keys) or (u'source:maxspeed' in keys) or (u'source:maxspeed:backward' in keys) or (u'source:maxspeed:forward' in keys) or (u'source:name' in keys) or (u'source:old_name' in keys) or (u'source:population' in keys) or (u'source:postal_code' in keys) or (u'source:postcode' in keys) or (u'source:ref' in keys) or (u'source:ref:INSEE' in keys) or (u'source:surface' in keys): + if (u'border_type' in keys) or (u'piste:difficulty' in keys) or (u'place' in keys) or (u'source:addr' in keys) or (u'source:addr:housenumber' in keys) or (u'source:addr:postcode' in keys) or (u'source:bicycle' in keys) or (u'source:bridge' in keys) or (u'source:building' in keys) or (u'source:date' in keys) or (u'source:designation' in keys) or (u'source:ele' in keys) or (u'source:height' in keys) or (u'source:hgv' in keys) or (u'source:highway' in keys) or (u'source:housenumber' in keys) or (u'source:lanes' in keys) or (u'source:lit' in keys) or (u'source:maxaxleload' in keys) or (u'source:maxspeed' in keys) or (u'source:maxspeed:backward' in keys) or (u'source:maxspeed:forward' in keys) or (u'source:name' in keys) or (u'source:old_name' in keys) or (u'source:population' in keys) or (u'source:postal_code' in keys) or (u'source:postcode' in keys) or (u'source:ref' in keys) or (u'source:ref:INSEE' in keys) or (u'source:surface' in keys): match = False if not match: capture_tags = {} @@ -1919,6 +1977,10 @@ def relation(self, data, tags, members): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'piste:difficulty') and not mapcss._tag_capture(capture_tags, 1, tags, u'piste:type')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'place') and not mapcss._tag_capture(capture_tags, 1, tags, u'name') and mapcss._tag_capture(capture_tags, 2, tags, u'place') != mapcss._value_capture(capture_tags, 2, u'islet')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'source:date') and not mapcss._tag_capture(capture_tags, 1, tags, u'source')) @@ -2030,7 +2092,7 @@ def relation(self, data, tags, members): if match: # group:tr("missing tag") # throwWarning:tr("{0} without {1}","{0.key}","{1.key}") - err.append({'class': 9001001, 'subclass': 583462851, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001001, 'subclass': 1591463529, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # *[transformer][!power] # *[recycling_type][amenity!=recycling] @@ -2270,6 +2332,18 @@ def relation(self, data, tags, members): # throwWarning:tr("{0} together with {1}","{0.tag}","{1.key}") err.append({'class': 9001002, 'subclass': 1004083393, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # relation[type=multipolygon][area=no] + if (u'area' in keys and u'type' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'multipolygon') and mapcss._tag_capture(capture_tags, 1, tags, u'area') == mapcss._value_capture(capture_tags, 1, u'no')) + except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwError:tr("{0} together with {1}","{0.tag}","{1.tag}") + err.append({'class': 9001002, 'subclass': 1091177792, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + # *[access][eval(number_of_tags())=1] # *[area][eval(number_of_tags())=1]!.area_yes_autofix # *[name][eval(number_of_tags())=1] @@ -2429,17 +2503,17 @@ def relation(self, data, tags, members): u'natural']) }}) - # *[sport][sport!=skiing][!building][!club][tourism!=hotel][highway!=raceway][!leisure][natural!~/^(beach|bare_rock|cliff|peak|water)$/][amenity!~/^(pub|restaurant|swimming_pool)$/][landuse!~/^(recreation_ground|piste|farm|farmland)$/][barrier!~/^(wall|retaining_wall)$/][!"piste:type"][shop!=sports] + # *[sport][sport!=skiing][!building][!club][tourism!=hotel][highway!=raceway][!leisure][natural!~/^(beach|bare_rock|cliff|peak|water)$/][amenity!~/^(pub|restaurant|swimming_pool)$/][landuse!~/^(recreation_ground|piste|farm|farmland)$/][barrier!~/^(wall|retaining_wall)$/][!"piste:type"][shop!=sports][attraction!=summer_toboggan] if (u'sport' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') != mapcss._value_capture(capture_tags, 1, u'skiing') and not mapcss._tag_capture(capture_tags, 2, tags, u'building') and not mapcss._tag_capture(capture_tags, 3, tags, u'club') and mapcss._tag_capture(capture_tags, 4, tags, u'tourism') != mapcss._value_capture(capture_tags, 4, u'hotel') and mapcss._tag_capture(capture_tags, 5, tags, u'highway') != mapcss._value_capture(capture_tags, 5, u'raceway') and not mapcss._tag_capture(capture_tags, 6, tags, u'leisure') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 7, self.re_29fa4401), mapcss._tag_capture(capture_tags, 7, tags, u'natural')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 8, self.re_64c931ef), mapcss._tag_capture(capture_tags, 8, tags, u'amenity')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 9, self.re_3b4f8f73), mapcss._tag_capture(capture_tags, 9, tags, u'landuse')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 10, self.re_68c05e86), mapcss._tag_capture(capture_tags, 10, tags, u'barrier')) and not mapcss._tag_capture(capture_tags, 11, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 12, tags, u'shop') != mapcss._value_capture(capture_tags, 12, u'sports')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') and mapcss._tag_capture(capture_tags, 1, tags, u'sport') != mapcss._value_capture(capture_tags, 1, u'skiing') and not mapcss._tag_capture(capture_tags, 2, tags, u'building') and not mapcss._tag_capture(capture_tags, 3, tags, u'club') and mapcss._tag_capture(capture_tags, 4, tags, u'tourism') != mapcss._value_capture(capture_tags, 4, u'hotel') and mapcss._tag_capture(capture_tags, 5, tags, u'highway') != mapcss._value_capture(capture_tags, 5, u'raceway') and not mapcss._tag_capture(capture_tags, 6, tags, u'leisure') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 7, self.re_29fa4401), mapcss._tag_capture(capture_tags, 7, tags, u'natural')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 8, self.re_64c931ef), mapcss._tag_capture(capture_tags, 8, tags, u'amenity')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 9, self.re_3b4f8f73), mapcss._tag_capture(capture_tags, 9, tags, u'landuse')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 10, self.re_68c05e86), mapcss._tag_capture(capture_tags, 10, tags, u'barrier')) and not mapcss._tag_capture(capture_tags, 11, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 12, tags, u'shop') != mapcss._value_capture(capture_tags, 12, u'sports') and mapcss._tag_capture(capture_tags, 13, tags, u'attraction') != mapcss._value_capture(capture_tags, 13, u'summer_toboggan')) except mapcss.RuleAbort: pass if match: # group:tr("missing tag") # throwWarning:tr("sport without physical feature") - err.append({'class': 9001001, 'subclass': 1531133249, 'text': mapcss.tr(u'sport without physical feature')}) + err.append({'class': 9001001, 'subclass': 1631566710, 'text': mapcss.tr(u'sport without physical feature')}) # *[building:levels][!building][!building:part] if (u'building:levels' in keys): @@ -2550,23 +2624,27 @@ class father: n.init(None) data = {'id': 0, 'lat': 0, 'lon': 0} - self.check_err(n.node(data, {u'source:addr:postcode': u'postman'}), expected={'class': 9001001, 'subclass': 1812055539}) - self.check_not_err(n.node(data, {u'addr:housenumber': u'42', u'source:addr': u'postman'}), expected={'class': 9001001, 'subclass': 1812055539}) - self.check_err(n.node(data, {u'source:addr': u'postman'}), expected={'class': 9001001, 'subclass': 1812055539}) + self.check_err(n.node(data, {u'source:addr:postcode': u'postman'}), expected={'class': 9001001, 'subclass': 1008153779}) + self.check_not_err(n.node(data, {u'addr:housenumber': u'42', u'source:addr': u'postman'}), expected={'class': 9001001, 'subclass': 1008153779}) + self.check_err(n.node(data, {u'source:addr': u'postman'}), expected={'class': 9001001, 'subclass': 1008153779}) self.check_not_err(n.node(data, {u'addr:postcode': u'12345', u'place': u'foo'}), expected={'class': 9001002, 'subclass': 2039567622}) self.check_err(n.node(data, {u'addr:housenumber': u'5', u'addr:postcode': u'12345', u'place': u'foo'}), expected={'class': 9001002, 'subclass': 2039567622}) self.check_err(n.node(data, {u'addr:housenumber': u'5', u'place': u'foo'}), expected={'class': 9001002, 'subclass': 2039567622}) self.check_not_err(n.node(data, {u'highway': u'street_lamp', u'natural': u'birds_nest'}), expected={'class': 9001002, 'subclass': 1750941961}) - self.check_not_err(n.node(data, {u'amenity': u'restaurant', u'sport': u'10pin'}), expected={'class': 9001001, 'subclass': 1531133249}) - self.check_not_err(n.node(data, {u'natural': u'beach', u'sport': u'beachvolleyball'}), expected={'class': 9001001, 'subclass': 1531133249}) - self.check_not_err(n.node(data, {u'sport': u'skiing'}), expected={'class': 9001001, 'subclass': 1531133249}) - self.check_not_err(n.node(data, {u'sport': u'swimming', u'tourism': u'hotel'}), expected={'class': 9001001, 'subclass': 1531133249}) - self.check_not_err(n.node(data, {u'leisure': u'pitch', u'sport': u'tennis'}), expected={'class': 9001001, 'subclass': 1531133249}) - self.check_err(n.node(data, {u'sport': u'tennis'}), expected={'class': 9001001, 'subclass': 1531133249}) - self.check_not_err(n.way(data, {u'highway': u'unclassified', u'lanes': u'42'}, [0]), expected={'class': 9001001, 'subclass': 1275753529}) - self.check_err(n.way(data, {u'lanes': u'42'}, [0]), expected={'class': 9001001, 'subclass': 1275753529}) + self.check_not_err(n.node(data, {u'amenity': u'restaurant', u'sport': u'10pin'}), expected={'class': 9001001, 'subclass': 1631566710}) + self.check_not_err(n.node(data, {u'natural': u'beach', u'sport': u'beachvolleyball'}), expected={'class': 9001001, 'subclass': 1631566710}) + self.check_not_err(n.node(data, {u'sport': u'skiing'}), expected={'class': 9001001, 'subclass': 1631566710}) + self.check_not_err(n.node(data, {u'sport': u'swimming', u'tourism': u'hotel'}), expected={'class': 9001001, 'subclass': 1631566710}) + self.check_not_err(n.node(data, {u'leisure': u'pitch', u'sport': u'tennis'}), expected={'class': 9001001, 'subclass': 1631566710}) + self.check_err(n.node(data, {u'sport': u'tennis'}), expected={'class': 9001001, 'subclass': 1631566710}) + self.check_not_err(n.way(data, {u'highway': u'unclassified', u'lanes': u'42'}, [0]), expected={'class': 9001001, 'subclass': 2049980645}) + self.check_err(n.way(data, {u'lanes': u'42'}, [0]), expected={'class': 9001001, 'subclass': 2049980645}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'2'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'3', u'lanes:backward': u'2'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'3', u'oneway': u'-1'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_err(n.way(data, {u'highway': u'primary', u'lanes': u'3'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'4'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) + self.check_err(n.way(data, {u'highway': u'pedestrian', u'width': u'0.8'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) + self.check_err(n.way(data, {u'highway': u'pedestrian', u'width': u'1'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) + self.check_not_err(n.way(data, {u'highway': u'pedestrian', u'width': u'2'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) + self.check_not_err(n.way(data, {u'highway': u'pedestrian', u'width': u'5.5'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) diff --git a/plugins/Josm_de_openrailwaymap.py b/plugins/Josm_de_openrailwaymap.py index ac842e31c..6231fd769 100644 --- a/plugins/Josm_de_openrailwaymap.py +++ b/plugins/Josm_de_openrailwaymap.py @@ -430,7 +430,7 @@ def node(self, data, tags): # assertMatch:"node railway=signal railway:signal:speed_limit=\"DE-ESO:zs3\" railway:signal:speed_limit:form=light railway:signal:speed_limit:speed=foo" err.append({'class': 9016015, 'subclass': 1065351347, 'text': {'en': u'Zs3 light signal states should have the form \'speed[;speed …][;off][;?], speeds can only be multiples of 10'}}) - # node[railway=signal]["railway:signal:speed_limit"="DE-ESO:db:zs10"]["railway:signal:speed_limit:form"=light] + # node|z16-[railway=signal]["railway:signal:speed_limit"="DE-ESO:db:zs10"]["railway:signal:speed_limit:form"=light] if (u'railway' in keys and u'railway:signal:speed_limit' in keys and u'railway:signal:speed_limit:form' in keys): match = False if not match: @@ -442,7 +442,7 @@ def node(self, data, tags): # assertNoMatch:"node railway=signal railway:signal:speed_limit=\"DE-ESO:db:zs1\" railway:signal:speed_limit:form=light" # assertMatch:"node railway=signal railway:signal:speed_limit=\"DE-ESO:db:zs10\" railway:signal:speed_limit:form=light" # assertNoMatch:"node railway=signal railway:signal:speed_limit=\"DE-ESO:db:zs10\" railway:signal:speed_limit:form=sign" - err.append({'class': 9016016, 'subclass': 504597862, 'text': {'en': u'It is unclear if Zs10 light signals have ever been placed, please double check.'}}) + err.append({'class': 9016016, 'subclass': 1437297810, 'text': {'en': u'It is unclear if Zs10 light signals have ever been placed, please double check.'}}) return err @@ -844,9 +844,9 @@ class father: self.check_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:zs3', u'railway:signal:speed_limit:form': u'light', u'railway:signal:speed_limit:speed': u'200'}), expected={'class': 9016015, 'subclass': 1065351347}) self.check_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:zs3', u'railway:signal:speed_limit:form': u'light', u'railway:signal:speed_limit:speed': u'85'}), expected={'class': 9016015, 'subclass': 1065351347}) self.check_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:zs3', u'railway:signal:speed_limit:form': u'light', u'railway:signal:speed_limit:speed': u'foo'}), expected={'class': 9016015, 'subclass': 1065351347}) - self.check_not_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:db:zs1', u'railway:signal:speed_limit:form': u'light'}), expected={'class': 9016016, 'subclass': 504597862}) - self.check_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:db:zs10', u'railway:signal:speed_limit:form': u'light'}), expected={'class': 9016016, 'subclass': 504597862}) - self.check_not_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:db:zs10', u'railway:signal:speed_limit:form': u'sign'}), expected={'class': 9016016, 'subclass': 504597862}) + self.check_not_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:db:zs1', u'railway:signal:speed_limit:form': u'light'}), expected={'class': 9016016, 'subclass': 1437297810}) + self.check_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:db:zs10', u'railway:signal:speed_limit:form': u'light'}), expected={'class': 9016016, 'subclass': 1437297810}) + self.check_not_err(n.node(data, {u'railway': u'signal', u'railway:signal:speed_limit': u'DE-ESO:db:zs10', u'railway:signal:speed_limit:form': u'sign'}), expected={'class': 9016016, 'subclass': 1437297810}) self.check_err(n.way(data, {u'name': u'Kursbuchstrecke 710.1', u'railway': u'light_rail'}, [0]), expected={'class': 9016017, 'subclass': 460679615}) self.check_not_err(n.way(data, {u'railway': u'light_rail', u'ref': u'Kursbuchstrecke 710.1'}, [0]), expected={'class': 9016017, 'subclass': 460679615}) self.check_err(n.way(data, {u'name': u'KBS 258', u'railway': u'rail'}, [0]), expected={'class': 9016017, 'subclass': 460679615}) diff --git a/plugins/Josm_deprecated.py b/plugins/Josm_deprecated.py index 99b6734de..bc1535bdb 100644 --- a/plugins/Josm_deprecated.py +++ b/plugins/Josm_deprecated.py @@ -22,7 +22,7 @@ def init(self, logger): self.errors[9002010] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'Unspecific tag {0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} self.errors[9002011] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'key with uncommon character')} self.errors[9002012] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'uncommon short key')} - self.errors[9002013] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} + self.errors[9002013] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:bitcoin=yes', u'payment:litecoin=yes')} self.errors[9002015] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by \'\'left\'\', \'\'right\'\' or \'\'both\'\'.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))} self.errors[9002016] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0} is not recommended. Use the Reverse Ways function from the Tools menu.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} self.errors[9002017] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'The key {0} has an uncommon value.', mapcss._tag_uncapture(capture_tags, u'{1.key}'))} @@ -1036,6 +1036,7 @@ def node(self, data, tags): # *[amenity=yes] # *[leisure=yes] # *[shop="*"] + # *[shop=yes][amenity!=fuel] # *[craft=yes] # *[service=yes] # *[place=yes] @@ -1069,6 +1070,10 @@ def node(self, data, tags): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'*')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'yes') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'fuel')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'craft') == mapcss._value_capture(capture_tags, 0, u'yes')) @@ -1083,7 +1088,7 @@ def node(self, data, tags): except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0}={1} is unspecific. Please replace ''{1}'' by a specific value.","{0.key}","{0.value}") - err.append({'class': 9002007, 'subclass': 1335965258, 'text': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9002007, 'subclass': 962298405, 'text': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) # *[place_name][!name] if (u'place_name' in keys): @@ -1471,11 +1476,8 @@ def node(self, data, tags): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:credit_cards') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:mastercard=yes" - # suggestAlternative:"payment:visa=yes" - err.append({'class': 9002013, 'subclass': 705181097, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:mastercard=yes","payment:visa=yes") + err.append({'class': 9002013, 'subclass': 705181097, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:mastercard=yes', u'payment:visa=yes')}) # *[payment:debit_cards=yes] if (u'payment:debit_cards' in keys): @@ -1485,11 +1487,8 @@ def node(self, data, tags): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:debit_cards') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:girocard=yes" - # suggestAlternative:"payment:maestro=yes" - err.append({'class': 9002013, 'subclass': 679215558, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:maestro=yes","payment:girocard=yes") + err.append({'class': 9002013, 'subclass': 679215558, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:maestro=yes', u'payment:girocard=yes')}) # *[payment:electronic_purses=yes] if (u'payment:electronic_purses' in keys): @@ -1499,11 +1498,8 @@ def node(self, data, tags): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:electronic_purses') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:ep_geldkarte=yes" - # suggestAlternative:"payment:ep_quick=yes" - err.append({'class': 9002013, 'subclass': 1440457244, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:ep_geldkarte=yes","payment:ep_quick=yes") + err.append({'class': 9002013, 'subclass': 1440457244, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:ep_geldkarte=yes', u'payment:ep_quick=yes')}) # *[payment:cryptocurrencies=yes] if (u'payment:cryptocurrencies' in keys): @@ -1513,11 +1509,8 @@ def node(self, data, tags): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:cryptocurrencies') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:bitcoin=yes" - # suggestAlternative:"payment:litecoin=yes" - err.append({'class': 9002013, 'subclass': 1325255949, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:bitcoin=yes","payment:litecoin=yes") + err.append({'class': 9002013, 'subclass': 1325255949, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:bitcoin=yes', u'payment:litecoin=yes')}) # *[payment:ep_quick] # *[payment:ep_cash] @@ -2250,6 +2243,25 @@ def node(self, data, tags): u'amenity']) }}) + # *[amenity=sauna] + if (u'amenity' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'sauna')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"leisure=sauna" + # fixChangeKey:"amenity => leisure" + err.append({'class': 9002001, 'subclass': 1450116742, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'leisure', mapcss.tag(tags, u'amenity')]]), + '-': ([ + u'amenity']) + }}) + # *[sport=skating] if (u'sport' in keys): match = False @@ -2660,6 +2672,231 @@ def node(self, data, tags): [u'amenity',u'toilets']]) }}) + # *[man_made=MDF] + # *[man_made=telephone_exchange] + if (u'man_made' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'MDF')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'telephone_exchange')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixRemove:"man_made" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 634698090, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'exchange']]), + '-': ([ + u'man_made']) + }}) + + # *[building=central_office] + if (u'building' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building') == mapcss._value_capture(capture_tags, 0, u'central_office')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixAdd:"building=yes" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 1091970270, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'building',u'yes'], + [u'telecom',u'exchange']]) + }}) + + # *[telecom=central_office] + if (u'telecom' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'telecom') == mapcss._value_capture(capture_tags, 0, u'central_office')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 1503278830, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'exchange']]) + }}) + + # node[communication=outdoor_dslam] + # node[man_made=outdoor_dslam] + # node[street_cabinet=outdoor_dslam] + if (u'communication' in keys) or (u'man_made' in keys) or (u'street_cabinet' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'communication') == mapcss._value_capture(capture_tags, 0, u'outdoor_dslam')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'outdoor_dslam')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'street_cabinet') == mapcss._value_capture(capture_tags, 0, u'outdoor_dslam')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=service_device" + # fixAdd:"telecom=service_device" + # fixRemove:"{0.key}" + err.append({'class': 9002001, 'subclass': 1243371306, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'service_device']]), + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # node[telecom=dslam] + # node[telecom=outdoor_dslam] + if (u'telecom' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'telecom') == mapcss._value_capture(capture_tags, 0, u'dslam')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'telecom') == mapcss._value_capture(capture_tags, 0, u'outdoor_dslam')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=service_device" + # fixAdd:"telecom=service_device" + err.append({'class': 9002001, 'subclass': 781930166, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'service_device']]) + }}) + + # node[amenity=fire_hydrant] + if (u'amenity' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'fire_hydrant')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"emergency=fire_hydrant" + # fixChangeKey:"amenity => emergency" + err.append({'class': 9002001, 'subclass': 967497433, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'emergency', mapcss.tag(tags, u'amenity')]]), + '-': ([ + u'amenity']) + }}) + + # node[fire_hydrant:type=pond] + if (u'fire_hydrant:type' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'fire_hydrant:type') == mapcss._value_capture(capture_tags, 0, u'pond')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"water_source=pond" + # fixAdd:"water_source=pond" + # fixRemove:"{0.key}" + err.append({'class': 9002001, 'subclass': 1583105855, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'water_source',u'pond']]), + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # node[fire_hydrant:flow_capacity] + if (u'fire_hydrant:flow_capacity' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'fire_hydrant:flow_capacity')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # suggestAlternative:"flow_rate" + err.append({'class': 9002001, 'subclass': 1864683984, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + + # node[emergency=fire_hydrant][in_service=no] + if (u'emergency' in keys and u'in_service' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'fire_hydrant') and mapcss._tag_capture(capture_tags, 1, tags, u'in_service') == mapcss._value_capture(capture_tags, 1, u'no')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{1.tag}") + # suggestAlternative:"disused:emergency=fire_hydrant" + # fixAdd:"disused:emergency=fire_hydrant" + # fixRemove:"{0.key}" + # fixRemove:"{1.key}" + err.append({'class': 9002001, 'subclass': 552149777, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'disused:emergency',u'fire_hydrant']]), + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}'), + mapcss._tag_uncapture(capture_tags, u'{1.key}')]) + }}) + + # node[fire_hydrant:water_source] + if (u'fire_hydrant:water_source' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'fire_hydrant:water_source')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # suggestAlternative:"water_source" + # fixChangeKey:"fire_hydrant:water_source => water_source" + err.append({'class': 9002001, 'subclass': 1207497718, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'water_source', mapcss.tag(tags, u'fire_hydrant:water_source')]]), + '-': ([ + u'fire_hydrant:water_source']) + }}) + + # *[natural=waterfall] + if (u'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'natural') == mapcss._value_capture(capture_tags, 0, u'waterfall')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"waterway=waterfall" + # fixChangeKey:"natural => waterway" + err.append({'class': 9002001, 'subclass': 764711734, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'waterway', mapcss.tag(tags, u'natural')]]), + '-': ([ + u'natural']) + }}) + return err def way(self, data, tags, nds): @@ -3662,6 +3899,7 @@ def way(self, data, tags, nds): # *[amenity=yes] # *[leisure=yes] # *[shop="*"] + # *[shop=yes][amenity!=fuel] # *[craft=yes] # *[service=yes] # *[place=yes] @@ -3695,6 +3933,10 @@ def way(self, data, tags, nds): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'*')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'yes') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'fuel')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'craft') == mapcss._value_capture(capture_tags, 0, u'yes')) @@ -3709,7 +3951,7 @@ def way(self, data, tags, nds): except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0}={1} is unspecific. Please replace ''{1}'' by a specific value.","{0.key}","{0.value}") - err.append({'class': 9002007, 'subclass': 1335965258, 'text': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9002007, 'subclass': 962298405, 'text': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) # *[place_name][!name] if (u'place_name' in keys): @@ -4146,11 +4388,8 @@ def way(self, data, tags, nds): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:credit_cards') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:mastercard=yes" - # suggestAlternative:"payment:visa=yes" - err.append({'class': 9002013, 'subclass': 705181097, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:mastercard=yes","payment:visa=yes") + err.append({'class': 9002013, 'subclass': 705181097, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:mastercard=yes', u'payment:visa=yes')}) # *[payment:debit_cards=yes] if (u'payment:debit_cards' in keys): @@ -4160,11 +4399,8 @@ def way(self, data, tags, nds): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:debit_cards') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:girocard=yes" - # suggestAlternative:"payment:maestro=yes" - err.append({'class': 9002013, 'subclass': 679215558, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:maestro=yes","payment:girocard=yes") + err.append({'class': 9002013, 'subclass': 679215558, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:maestro=yes', u'payment:girocard=yes')}) # *[payment:electronic_purses=yes] if (u'payment:electronic_purses' in keys): @@ -4174,11 +4410,8 @@ def way(self, data, tags, nds): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:electronic_purses') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:ep_geldkarte=yes" - # suggestAlternative:"payment:ep_quick=yes" - err.append({'class': 9002013, 'subclass': 1440457244, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:ep_geldkarte=yes","payment:ep_quick=yes") + err.append({'class': 9002013, 'subclass': 1440457244, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:ep_geldkarte=yes', u'payment:ep_quick=yes')}) # *[payment:cryptocurrencies=yes] if (u'payment:cryptocurrencies' in keys): @@ -4188,11 +4421,8 @@ def way(self, data, tags, nds): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:cryptocurrencies') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:bitcoin=yes" - # suggestAlternative:"payment:litecoin=yes" - err.append({'class': 9002013, 'subclass': 1325255949, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:bitcoin=yes","payment:litecoin=yes") + err.append({'class': 9002013, 'subclass': 1325255949, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:bitcoin=yes', u'payment:litecoin=yes')}) # *[payment:ep_quick] # *[payment:ep_cash] @@ -4925,6 +5155,25 @@ def way(self, data, tags, nds): u'amenity']) }}) + # *[amenity=sauna] + if (u'amenity' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'sauna')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"leisure=sauna" + # fixChangeKey:"amenity => leisure" + err.append({'class': 9002001, 'subclass': 1450116742, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'leisure', mapcss.tag(tags, u'amenity')]]), + '-': ([ + u'amenity']) + }}) + # *[sport=skating] if (u'sport' in keys): match = False @@ -5471,6 +5720,86 @@ def way(self, data, tags, nds): [u'power',u'line']]) }}) + # *[man_made=MDF] + # *[man_made=telephone_exchange] + if (u'man_made' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'MDF')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'telephone_exchange')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixRemove:"man_made" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 634698090, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'exchange']]), + '-': ([ + u'man_made']) + }}) + + # *[building=central_office] + if (u'building' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building') == mapcss._value_capture(capture_tags, 0, u'central_office')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixAdd:"building=yes" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 1091970270, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'building',u'yes'], + [u'telecom',u'exchange']]) + }}) + + # *[telecom=central_office] + if (u'telecom' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'telecom') == mapcss._value_capture(capture_tags, 0, u'central_office')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 1503278830, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'exchange']]) + }}) + + # *[natural=waterfall] + if (u'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'natural') == mapcss._value_capture(capture_tags, 0, u'waterfall')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"waterway=waterfall" + # fixChangeKey:"natural => waterway" + err.append({'class': 9002001, 'subclass': 764711734, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'waterway', mapcss.tag(tags, u'natural')]]), + '-': ([ + u'natural']) + }}) + return err def relation(self, data, tags, members): @@ -6426,6 +6755,7 @@ def relation(self, data, tags, members): # *[amenity=yes] # *[leisure=yes] # *[shop="*"] + # *[shop=yes][amenity!=fuel] # *[craft=yes] # *[service=yes] # *[place=yes] @@ -6459,6 +6789,10 @@ def relation(self, data, tags, members): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'*')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'yes') and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'fuel')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'craft') == mapcss._value_capture(capture_tags, 0, u'yes')) @@ -6473,7 +6807,7 @@ def relation(self, data, tags, members): except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0}={1} is unspecific. Please replace ''{1}'' by a specific value.","{0.key}","{0.value}") - err.append({'class': 9002007, 'subclass': 1335965258, 'text': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + err.append({'class': 9002007, 'subclass': 962298405, 'text': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) # *[place_name][!name] if (u'place_name' in keys): @@ -6861,11 +7195,8 @@ def relation(self, data, tags, members): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:credit_cards') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:mastercard=yes" - # suggestAlternative:"payment:visa=yes" - err.append({'class': 9002013, 'subclass': 705181097, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:mastercard=yes","payment:visa=yes") + err.append({'class': 9002013, 'subclass': 705181097, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:mastercard=yes', u'payment:visa=yes')}) # *[payment:debit_cards=yes] if (u'payment:debit_cards' in keys): @@ -6875,11 +7206,8 @@ def relation(self, data, tags, members): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:debit_cards') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:girocard=yes" - # suggestAlternative:"payment:maestro=yes" - err.append({'class': 9002013, 'subclass': 679215558, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:maestro=yes","payment:girocard=yes") + err.append({'class': 9002013, 'subclass': 679215558, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:maestro=yes', u'payment:girocard=yes')}) # *[payment:electronic_purses=yes] if (u'payment:electronic_purses' in keys): @@ -6889,11 +7217,8 @@ def relation(self, data, tags, members): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:electronic_purses') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:ep_geldkarte=yes" - # suggestAlternative:"payment:ep_quick=yes" - err.append({'class': 9002013, 'subclass': 1440457244, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:ep_geldkarte=yes","payment:ep_quick=yes") + err.append({'class': 9002013, 'subclass': 1440457244, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:ep_geldkarte=yes', u'payment:ep_quick=yes')}) # *[payment:cryptocurrencies=yes] if (u'payment:cryptocurrencies' in keys): @@ -6903,11 +7228,8 @@ def relation(self, data, tags, members): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'payment:cryptocurrencies') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} is inaccurate","{0.tag}") - # suggestAlternative:"..." - # suggestAlternative:"payment:bitcoin=yes" - # suggestAlternative:"payment:litecoin=yes" - err.append({'class': 9002013, 'subclass': 1325255949, 'text': mapcss.tr(u'{0} is inaccurate', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # throwWarning:tr("{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.","{0.tag}","payment:bitcoin=yes","payment:litecoin=yes") + err.append({'class': 9002013, 'subclass': 1325255949, 'text': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:bitcoin=yes', u'payment:litecoin=yes')}) # *[payment:ep_quick] # *[payment:ep_cash] @@ -7621,6 +7943,25 @@ def relation(self, data, tags, members): u'amenity']) }}) + # *[amenity=sauna] + if (u'amenity' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'amenity') == mapcss._value_capture(capture_tags, 0, u'sauna')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"leisure=sauna" + # fixChangeKey:"amenity => leisure" + err.append({'class': 9002001, 'subclass': 1450116742, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'leisure', mapcss.tag(tags, u'amenity')]]), + '-': ([ + u'amenity']) + }}) + # *[sport=skating] if (u'sport' in keys): match = False @@ -7831,6 +8172,86 @@ def relation(self, data, tags, members): [u'amenity',u'toilets']]) }}) + # *[man_made=MDF] + # *[man_made=telephone_exchange] + if (u'man_made' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'MDF')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'man_made') == mapcss._value_capture(capture_tags, 0, u'telephone_exchange')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixRemove:"man_made" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 634698090, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'exchange']]), + '-': ([ + u'man_made']) + }}) + + # *[building=central_office] + if (u'building' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building') == mapcss._value_capture(capture_tags, 0, u'central_office')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixAdd:"building=yes" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 1091970270, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'building',u'yes'], + [u'telecom',u'exchange']]) + }}) + + # *[telecom=central_office] + if (u'telecom' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'telecom') == mapcss._value_capture(capture_tags, 0, u'central_office')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"telecom=exchange" + # fixAdd:"telecom=exchange" + err.append({'class': 9002001, 'subclass': 1503278830, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'telecom',u'exchange']]) + }}) + + # *[natural=waterfall] + if (u'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'natural') == mapcss._value_capture(capture_tags, 0, u'waterfall')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"waterway=waterfall" + # fixChangeKey:"natural => waterway" + err.append({'class': 9002001, 'subclass': 764711734, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'waterway', mapcss.tag(tags, u'natural')]]), + '-': ([ + u'natural']) + }}) + return err diff --git a/plugins/Josm_geometry.py b/plugins/Josm_geometry.py index 15ecbf360..5e92d84bd 100644 --- a/plugins/Josm_geometry.py +++ b/plugins/Josm_geometry.py @@ -14,7 +14,6 @@ def init(self, logger): self.errors[9003002] = {'item': 9003, 'level': 3, 'tag': ["geom"], 'desc': mapcss.tr(u'{0} on a node. Should be used on a way or relation.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} self.errors[9003003] = {'item': 9003, 'level': 3, 'tag': ["geom"], 'desc': mapcss.tr(u'{0} on a node. Should be drawn as an area.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} self.errors[9003004] = {'item': 9003, 'level': 2, 'tag': ["geom"], 'desc': mapcss.tr(u'{0} on a node. Should be used in a relation', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} - self.errors[9003005] = {'item': 9003, 'level': 3, 'tag': ["geom"], 'desc': mapcss.tr(u'suspicious tag combination')} self.errors[9003006] = {'item': 9003, 'level': 3, 'tag': ["geom"], 'desc': mapcss.tr(u'{0} on a node', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} self.errors[9003007] = {'item': 9003, 'level': 3, 'tag': ["geom"], 'desc': mapcss.tr(u'{0} on a way. Should be used on a node.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} self.errors[9003008] = {'item': 9003, 'level': 2, 'tag': ["geom"], 'desc': mapcss.tr(u'{0} on a way. Should be used in a relation', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} @@ -259,6 +258,7 @@ def node(self, data, tags): # node[golf=bunker] # node[golf=fairway] # node[area=yes] + # node[area:highway] # node[landuse] # node[natural=scree] # node[natural=scrub] @@ -274,6 +274,8 @@ def node(self, data, tags): # node[natural=wood] # node[natural=bare_rock] # node[natural=glacier] + # node[leisure=park][natural!=tree] + # node[leisure=nature_reserve] # node[waterway=riverbank] # node[man_made=bridge] # node[man_made=breakwater] @@ -282,7 +284,7 @@ def node(self, data, tags): # node[power=switchgear] # node[building:part] # node[source:outline] - if (u'aeroway' in keys) or (u'area' in keys) or (u'building:part' in keys) or (u'golf' in keys) or (u'landuse' in keys) or (u'man_made' in keys) or (u'natural' in keys) or (u'power' in keys) or (u'source:outline' in keys) or (u'waterway' in keys): + if (u'aeroway' in keys) or (u'area' in keys) or (u'area:highway' in keys) or (u'building:part' in keys) or (u'golf' in keys) or (u'landuse' in keys) or (u'leisure' in keys) or (u'man_made' in keys) or (u'natural' in keys) or (u'power' in keys) or (u'source:outline' in keys) or (u'waterway' in keys): match = False if not match: capture_tags = {} @@ -300,6 +302,10 @@ def node(self, data, tags): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'area') == mapcss._value_capture(capture_tags, 0, u'yes')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'area:highway')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'landuse')) @@ -360,6 +366,14 @@ def node(self, data, tags): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'natural') == mapcss._value_capture(capture_tags, 0, u'glacier')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'park') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') != mapcss._value_capture(capture_tags, 1, u'tree')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'nature_reserve')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') == mapcss._value_capture(capture_tags, 0, u'riverbank')) @@ -394,17 +408,22 @@ def node(self, data, tags): except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} on a node. Should be drawn as an area.","{0.tag}") - err.append({'class': 9003003, 'subclass': 913295728, 'text': mapcss.tr(u'{0} on a node. Should be drawn as an area.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9003003, 'subclass': 1633038746, 'text': mapcss.tr(u'{0} on a node. Should be drawn as an area.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) # node[type=multipolygon] + # node[interval] # node[route] # node[restriction] - if (u'restriction' in keys) or (u'route' in keys) or (u'type' in keys): + if (u'interval' in keys) or (u'restriction' in keys) or (u'route' in keys) or (u'type' in keys): match = False if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'multipolygon')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'interval')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route')) @@ -415,7 +434,7 @@ def node(self, data, tags): except mapcss.RuleAbort: pass if match: # throwError:tr("{0} on a node. Should be used in a relation","{0.tag}") - err.append({'class': 9003004, 'subclass': 1669293716, 'text': mapcss.tr(u'{0} on a node. Should be used in a relation', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9003004, 'subclass': 104835602, 'text': mapcss.tr(u'{0} on a node. Should be used in a relation', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) # node[man_made!=monitoring_station][at(0.0,0.0)] if True: @@ -429,33 +448,6 @@ def node(self, data, tags): # fixDeleteObject:this err.append({'class': 9003009, 'subclass': 829325630, 'text': mapcss.tr(u'Object at Position 0.00E 0.00N. There is nothing at this position except an already mapped weather buoy.')}) - # node[leisure=park][natural=tree] - if (u'leisure' in keys and u'natural' in keys): - match = False - if not match: - capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'park') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') == mapcss._value_capture(capture_tags, 1, u'tree')) - except mapcss.RuleAbort: pass - if match: - # group:tr("suspicious tag combination") - # throwWarning:tr("{0} together with {1} on a node. Remove {0}.","{0.tag}","{1.tag}") - # fixRemove:"leisure" - err.append({'class': 9003005, 'subclass': 1715941543, 'text': mapcss.tr(u'{0} together with {1} on a node. Remove {0}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { - '-': ([ - u'leisure']) - }}) - - # node[leisure=park][natural!=tree] - if (u'leisure' in keys): - match = False - if not match: - capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'park') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') != mapcss._value_capture(capture_tags, 1, u'tree')) - except mapcss.RuleAbort: pass - if match: - # throwWarning:tr("{0} on a node. Should be drawn as an area.","{0.tag}") - err.append({'class': 9003003, 'subclass': 317377122, 'text': mapcss.tr(u'{0} on a node. Should be drawn as an area.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) - # node[source:geometry] if (u'source:geometry' in keys): match = False @@ -481,7 +473,9 @@ def way(self, data, tags, nds): err = [] + # way[emergency=fire_hydrant] # way[entrance] + # way[door] # way[railway=subway_entrance] # way[man_made=survey_point] # way[aeroway=holding_position] @@ -504,12 +498,20 @@ def way(self, data, tags, nds): # way[highway=turning_loop] # way[highway=turning_circle] # way[highway=motorway_junction] - if (u'aeroway' in keys) or (u'amenity' in keys) or (u'entrance' in keys) or (u'highway' in keys) or (u'man_made' in keys) or (u'natural' in keys) or (u'power' in keys) or (u'railway' in keys): + if (u'aeroway' in keys) or (u'amenity' in keys) or (u'door' in keys) or (u'emergency' in keys) or (u'entrance' in keys) or (u'highway' in keys) or (u'man_made' in keys) or (u'natural' in keys) or (u'power' in keys) or (u'railway' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'fire_hydrant')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'entrance')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'door')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'subway_entrance')) @@ -600,12 +602,13 @@ def way(self, data, tags, nds): except mapcss.RuleAbort: pass if match: # throwWarning:tr("{0} on a way. Should be used on a node.","{0.tag}") - err.append({'class': 9003007, 'subclass': 1466799427, 'text': mapcss.tr(u'{0} on a way. Should be used on a node.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9003007, 'subclass': 1144340551, 'text': mapcss.tr(u'{0} on a way. Should be used on a node.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) # way[restriction][restriction=~/^(no_right_turn|no_left_turn|no_u_turn|no_straight_on|only_right_turn|only_left_turn|only_straight_on|no_entry|no_exit)$/] # way[type=multipolygon] + # way[interval][route!=ferry] # way[route=bus] - if (u'restriction' in keys) or (u'route' in keys) or (u'type' in keys): + if (u'interval' in keys) or (u'restriction' in keys) or (u'route' in keys) or (u'type' in keys): match = False if not match: capture_tags = {} @@ -615,13 +618,17 @@ def way(self, data, tags, nds): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'multipolygon')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'interval') and mapcss._tag_capture(capture_tags, 1, tags, u'route') != mapcss._value_capture(capture_tags, 1, u'ferry')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'route') == mapcss._value_capture(capture_tags, 0, u'bus')) except mapcss.RuleAbort: pass if match: # throwError:tr("{0} on a way. Should be used in a relation","{0.tag}") - err.append({'class': 9003008, 'subclass': 1728608057, 'text': mapcss.tr(u'{0} on a way. Should be used in a relation', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + err.append({'class': 9003008, 'subclass': 665916193, 'text': mapcss.tr(u'{0} on a way. Should be used in a relation', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) # way[place=island]!:closed if (u'place' in keys): diff --git a/plugins/Josm_numeric.py b/plugins/Josm_numeric.py index a8c0cd75c..d12c891b0 100644 --- a/plugins/Josm_numeric.py +++ b/plugins/Josm_numeric.py @@ -26,6 +26,7 @@ def init(self, logger): self.re_035d45f0 = re.compile(ur'^(([0-9]+\.?[0-9]*( (t|kg|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$') self.re_066203d3 = re.compile(ur'^[0-9]+$') + self.re_08f211f3 = re.compile(ur'^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$') self.re_0ae2edfd = re.compile(ur'^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$') self.re_0b0f0f56 = re.compile(ur'^0$|^(-|\+)?[1-5]$') self.re_18424cc6 = re.compile(ur'^[0-9]+,[0-9][0-9]?( (m|ft))?$') @@ -522,6 +523,28 @@ def node(self, data, tags): # assertMatch:"node ele=high" err.append({'class': 9006011, 'subclass': 1781084832, 'text': mapcss.tr(u'{0} must be a numeric value, in meters and without units', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # node[fire_hydrant:pressure="#"] + if (u'fire_hydrant:pressure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'fire_hydrant:pressure') == mapcss._value_capture(capture_tags, 0, u'#')) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("unusual value of {0}","{0.key}") + err.append({'class': 9006010, 'subclass': 256087474, 'text': mapcss.tr(u'unusual value of {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + + # *[interval][interval!~/^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] + if (u'interval' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'interval') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_08f211f3), mapcss._tag_capture(capture_tags, 1, tags, u'interval'))) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("unusual value of {0}","{0.key}") + err.append({'class': 9006010, 'subclass': 549662812, 'text': mapcss.tr(u'unusual value of {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + return err def way(self, data, tags, nds): @@ -1004,6 +1027,25 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} must be a numeric value, in meters and without units","{0.key}") err.append({'class': 9006011, 'subclass': 1781084832, 'text': mapcss.tr(u'{0} must be a numeric value, in meters and without units', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[interval][interval!~/^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] + if (u'interval' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'interval') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_08f211f3), mapcss._tag_capture(capture_tags, 1, tags, u'interval'))) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("unusual value of {0}","{0.key}") + # assertNoMatch:"way interval=00:05" + # assertNoMatch:"way interval=00:05:00" + # assertMatch:"way interval=00:65:00" + # assertNoMatch:"way interval=03:00:00" + # assertMatch:"way interval=0:5:0" + # assertMatch:"way interval=123" + # assertNoMatch:"way interval=20" + # assertNoMatch:"way interval=5" + err.append({'class': 9006010, 'subclass': 549662812, 'text': mapcss.tr(u'unusual value of {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + return err def relation(self, data, tags, members): @@ -1338,6 +1380,17 @@ def relation(self, data, tags, members): # throwWarning:tr("{0} must be a numeric value, in meters and without units","{0.key}") err.append({'class': 9006011, 'subclass': 1781084832, 'text': mapcss.tr(u'{0} must be a numeric value, in meters and without units', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[interval][interval!~/^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] + if (u'interval' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'interval') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_08f211f3), mapcss._tag_capture(capture_tags, 1, tags, u'interval'))) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("unusual value of {0}","{0.key}") + err.append({'class': 9006010, 'subclass': 549662812, 'text': mapcss.tr(u'unusual value of {0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + return err @@ -1558,3 +1611,11 @@ class father: self.check_not_err(n.way(data, {u'highway': u'residential', u'lanes': u'1'}, [0]), expected={'class': 9006009, 'subclass': 10320184}) self.check_err(n.way(data, {u'highway': u'residential', u'lanes': u'1;2'}, [0]), expected={'class': 9006009, 'subclass': 10320184}) self.check_err(n.way(data, {u'highway': u'residential', u'lanes': u'5.5'}, [0]), expected={'class': 9006009, 'subclass': 10320184}) + self.check_not_err(n.way(data, {u'interval': u'00:05'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_not_err(n.way(data, {u'interval': u'00:05:00'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_err(n.way(data, {u'interval': u'00:65:00'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_not_err(n.way(data, {u'interval': u'03:00:00'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_err(n.way(data, {u'interval': u'0:5:0'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_err(n.way(data, {u'interval': u'123'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_not_err(n.way(data, {u'interval': u'20'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) + self.check_not_err(n.way(data, {u'interval': u'5'}, [0]), expected={'class': 9006010, 'subclass': 549662812}) diff --git a/plugins/Josm_openrailwaymap.py b/plugins/Josm_openrailwaymap.py index 631ef1f1f..9d432d45a 100644 --- a/plugins/Josm_openrailwaymap.py +++ b/plugins/Josm_openrailwaymap.py @@ -51,6 +51,7 @@ def init(self, logger): self.errors[9015041] = {'item': 9015, 'level': 3, 'tag': ["tag", "railway"], 'desc': {'en': u'controlled_area relations are deprecated'}} self.errors[9015042] = {'item': 9015, 'level': 2, 'tag': ["tag", "railway"], 'desc': {'en': u'interlocking relation without type=railway'}} self.errors[9015043] = {'item': 9015, 'level': 2, 'tag': ["tag", "railway"], 'desc': {'en': u'interlocking relation with type other than railway'}} + self.errors[9015044] = {'item': 9015, 'level': 3, 'tag': ["tag", "railway"], 'desc': mapcss.tr(u'{0}={1} without name', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))} self.re_066203d3 = re.compile(ur'^[0-9]+$') self.re_0e3375d5 = re.compile(ur'[Vv]iadu[ck]t') @@ -568,6 +569,75 @@ def node(self, data, tags): [u'railway:switch:resetting',u'yes']]) }}) + # node[railway=station][!name] + # node[railway=halt][!name] + # node[railway=junction][!name] + # node[railway=spur_junction][!name] + # node[railway=service_station][!name] + # node[railway=site][!name] + # node[railway=tram_stop][!name] + # node[railway=yard][!name] + # node[railway=crossover][!name] + if (u'railway' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'station') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'halt') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'junction') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'spur_junction') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'service_station') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'site') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'tram_stop') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'yard') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') == mapcss._value_capture(capture_tags, 0, u'crossover') and not mapcss._tag_capture(capture_tags, 1, tags, u'name')) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0}={1} without name","{0.key}","{0.value}") + # assertNoMatch:"node railway=crossover name=foo" + # assertMatch:"node railway=crossover" + # assertNoMatch:"node railway=halt name=foo" + # assertMatch:"node railway=halt" + # assertNoMatch:"node railway=junction name=foo" + # assertMatch:"node railway=junction" + # assertNoMatch:"node railway=service_station name=foo" + # assertMatch:"node railway=service_station" + # assertNoMatch:"node railway=site name=foo" + # assertMatch:"node railway=site" + # assertNoMatch:"node railway=spur_junction name=foo" + # assertMatch:"node railway=spur_junction" + # assertNoMatch:"node railway=station name=foo" + # assertMatch:"node railway=station" + # assertNoMatch:"node railway=tram_stop name=foo" + # assertMatch:"node railway=tram_stop" + # assertNoMatch:"node railway=yard name=foo" + # assertMatch:"node railway=yard" + err.append({'class': 9015044, 'subclass': 1983319850, 'text': mapcss.tr(u'{0}={1} without name', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))}) + return err def way(self, data, tags, nds): @@ -1569,6 +1639,24 @@ class father: self.check_not_err(n.node(data, {u'railway': u'switch', u'railway:switch': u'default'}), expected={'class': 9015040, 'subclass': 967663151}) self.check_err(n.node(data, {u'railway': u'switch', u'railway:switch': u'resetting', u'ref': u'2'}), expected={'class': 9015040, 'subclass': 967663151}) self.check_not_err(n.node(data, {u'railway': u'switch'}), expected={'class': 9015040, 'subclass': 967663151}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'crossover'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'crossover'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'halt'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'halt'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'junction'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'junction'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'service_station'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'service_station'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'site'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'site'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'spur_junction'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'spur_junction'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'station'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'station'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'tram_stop'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'tram_stop'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_not_err(n.node(data, {u'name': u'foo', u'railway': u'yard'}), expected={'class': 9015044, 'subclass': 1983319850}) + self.check_err(n.node(data, {u'railway': u'yard'}), expected={'class': 9015044, 'subclass': 1983319850}) self.check_not_err(n.way(data, {u'railway': u'rail', u'service': u'siding'}, [0]), expected={'class': 9015001, 'subclass': 1888453557}) self.check_not_err(n.way(data, {u'railway': u'rail', u'service': u'yard', u'usage': u'industrial'}, [0]), expected={'class': 9015001, 'subclass': 1888453557}) self.check_err(n.way(data, {u'railway': u'rail', u'service': u'siding', u'usage': u'main'}, [0]), expected={'class': 9015001, 'subclass': 1888453557}) diff --git a/plugins/Josm_territories.py b/plugins/Josm_territories.py index 2c6901e85..e56d02f84 100644 --- a/plugins/Josm_territories.py +++ b/plugins/Josm_territories.py @@ -113,6 +113,10 @@ def way(self, data, tags, nds): except mapcss.RuleAbort: pass if match: # throwError:tr("street name contains ss") + # assertMatch:"way name=Hauptstrasse" + # assertNoMatch:"way name=Hauptstraße" + # assertNoMatch:"way name=Kapitän-Strasser-Straße" + # assertNoMatch:"way name=Peter-Strasser-Platz" err.append({'class': 9009002, 'subclass': 821908491, 'text': mapcss.tr(u'street name contains ss')}) # *[addr:street=~/(?i).*Straße.*/][inside("LI,CH")] @@ -129,6 +133,8 @@ def way(self, data, tags, nds): except mapcss.RuleAbort: pass if match: # throwError:tr("street name contains ß") + # assertNoMatch:"way name=Hauptstrasse" + # assertMatch:"way name=Hauptstraße" err.append({'class': 9009003, 'subclass': 610086334, 'text': mapcss.tr(u'street name contains ß')}) return err @@ -205,4 +211,9 @@ class father: n.init(None) data = {'id': 0, 'lat': 0, 'lon': 0} - + self.check_err(n.way(data, {u'name': u'Hauptstrasse'}, [0]), expected={'class': 9009002, 'subclass': 821908491}) + self.check_not_err(n.way(data, {u'name': u'Hauptstraße'}, [0]), expected={'class': 9009002, 'subclass': 821908491}) + self.check_not_err(n.way(data, {u'name': u'Kapitän-Strasser-Straße'}, [0]), expected={'class': 9009002, 'subclass': 821908491}) + self.check_not_err(n.way(data, {u'name': u'Peter-Strasser-Platz'}, [0]), expected={'class': 9009002, 'subclass': 821908491}) + self.check_not_err(n.way(data, {u'name': u'Hauptstrasse'}, [0]), expected={'class': 9009003, 'subclass': 610086334}) + self.check_err(n.way(data, {u'name': u'Hauptstraße'}, [0]), expected={'class': 9009003, 'subclass': 610086334}) diff --git a/plugins/Josm_unnecessary.py b/plugins/Josm_unnecessary.py index b5190a0b2..09da12d4f 100644 --- a/plugins/Josm_unnecessary.py +++ b/plugins/Josm_unnecessary.py @@ -94,6 +94,22 @@ def node(self, data, tags): u'payment:cash']) }}) + # node[emergency=fire_hydrant][fire_hydrant:count=1] + if (u'emergency' in keys and u'fire_hydrant:count' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'fire_hydrant') and mapcss._tag_capture(capture_tags, 1, tags, u'fire_hydrant:count') == mapcss._value_capture(capture_tags, 1, 1)) + except mapcss.RuleAbort: pass + if match: + # group:tr("unnecessary tag") + # throwWarning:tr("{0} is unnecessary for {1}","{1.tag}","{0.tag}") + # fixRemove:"{1.key}" + err.append({'class': 9010001, 'subclass': 178896259, 'text': mapcss.tr(u'{0} is unnecessary for {1}', mapcss._tag_uncapture(capture_tags, u'{1.tag}'), mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{1.key}')]) + }}) + return err def way(self, data, tags, nds):