-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathJosm_Rules_Brazilian_Specific.py
4850 lines (4466 loc) · 356 KB
/
Josm_Rules_Brazilian_Specific.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#-*- coding: utf-8 -*-
import modules.mapcss_lib as mapcss
import regex as re # noqa
from plugins.Plugin import with_options # noqa
from plugins.PluginMapCSS import PluginMapCSS
class Josm_Rules_Brazilian_Specific(PluginMapCSS):
MAPCSS_URL = 'https://github.com/OSMBrasil/validador-josm/blob/master/Rules_Brazilian-Specific.validator.mapcss'
only_for = ['BR']
def init(self, logger):
super().init(logger)
tags = capture_tags = {} # noqa
self.errors[9018002] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('Brasil - Verificar'))
self.errors[9018003] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018004] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('nome supérfluo/incompleto de local de lazer'))
self.errors[9018005] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('nome supérfluo/incompleto de local de saúde'))
self.errors[9018006] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('Brasil - Correções e melhorias'))
self.errors[9018007] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('objeto com nomenclatura incorreta'))
self.errors[9018008] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} não deve ser utilizado em nó; utilizar a restrição na via', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018009] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018010] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} sem pelo menos uma das tags: {1} ou {2}', mapcss._tag_uncapture(capture_tags, '{0.value}'), mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{2.key}')))
self.errors[9018012] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} sem nome', mapcss._tag_uncapture(capture_tags, '{0.value}')))
self.errors[9018013] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018014] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{0.value}')))
self.errors[9018016] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('SAMU classificado de forma errada'))
self.errors[9018017] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('objeto não deve possuir {0}', mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018018] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{0.tag}')))
self.errors[9018019] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{2.key}')))
self.errors[9018020] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018021] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss.tag(tags, 'landuse')))
self.errors[9018022] = self.def_class(item = 9018, level = 2, tags = ["tag"], title = mapcss.tr('chave inválida: {0}', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018023] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018026] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('possível ausência de tag {0}', mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018027] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('ausência do tempo de duração ({0}) da balsa', mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018029] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('possível definição incorreta para praça: \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, '{2.key}')))
self.errors[9018030] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('utilizar prefixo em português (pt:) para {0}', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018031] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('nome utilizado de forma incorreta'))
self.errors[9018032] = self.def_class(item = 9018, level = 2, tags = ["tag"], title = mapcss.tr('nó não deve possuir {0}', mapcss._tag_uncapture(capture_tags, '{0.tag}')))
self.errors[9018033] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve possuir {1}', mapcss._tag_uncapture(capture_tags, '{0.tag}'), mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018034] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('valor incorreto para {0}', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018035] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('ausência de boundary=protected_area'))
self.errors[9018036] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve ser usado apenas em ways', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018037] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('utilize \'\'destination\'\' no caminho de saída ao invés de \'\'exit_to\'\''))
self.errors[9018039] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('o conteúdo de {0} deve fazer parte de ref, separado por ;', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018041] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('objeto incompleto: possui apenas {0}', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018042] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('objeto incompleto: possui apenas {0} e {1}', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018043] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('não utilizar \'\'{0}\'\' para locais sem número', mapcss.tag(tags, 'addr:housenumber')))
self.errors[9018044] = self.def_class(item = 9018, level = 2, tags = ["tag"], title = mapcss.tr('objeto contém Google como source'))
self.errors[9018046] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('relação não deve possuir {0}', mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018047] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve ser utilizado apenas em nós', mapcss._tag_uncapture(capture_tags, '{0.tag}')))
self.errors[9018048] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve possuir \'\'type=boundary\'\'', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018049] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} deve ser utilizado junto com {1}', mapcss._tag_uncapture(capture_tags, '{0.tag}'), mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018051] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('não classificar via como {0}', mapcss._tag_uncapture(capture_tags, '{0.tag}')))
self.errors[9018052] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} com nome supérfluo/incompleto', mapcss._tag_uncapture(capture_tags, '{0.key}')))
self.errors[9018053] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} não deve possuir {1}', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{1.tag}')))
self.errors[9018056] = self.def_class(item = 9018, level = 2, tags = ["tag"], title = mapcss.tr('{0} deve ser utilizado apenas no nó de saída da rodovia', mapcss._tag_uncapture(capture_tags, '{0.tag}')))
self.errors[9018063] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('uso incorreto de {0} com {1}', mapcss._tag_uncapture(capture_tags, '{0.tag}'), mapcss._tag_uncapture(capture_tags, '{1.tag}')))
self.errors[9018064] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('uso incorreto de {0}', mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018065] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('ausência de wetland=*'))
self.errors[9018066] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('\'\'{0}\'\' sem \'\'{1}\'\' definida', mapcss._tag_uncapture(capture_tags, '{0.tag}'), mapcss._tag_uncapture(capture_tags, '{1.key}')))
self.errors[9018067] = self.def_class(item = 9018, level = 3, tags = ["tag"], title = mapcss.tr('{0} inapropriada para \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{0.tag}')))
self.re_01454d46 = re.compile(r'(?i)\bmotel\b')
self.re_044c8944 = re.compile(r'^(?i)(?u)(SENAC|SENAI|Serviço Nacional de Aprendizagem)')
self.re_04873a60 = re.compile(r'^(river|stream)$')
self.re_05a345c7 = re.compile(r'^(forest|grass|greenfield|meadow|orchard)$')
self.re_066203d3 = re.compile(r'^[0-9]+$')
self.re_073e5345 = re.compile(r'\b[A-Z]{2,3} (- )?[0-9]{2,3}\b')
self.re_07f31a73 = re.compile(r'^(living_street|pedestrian|residential|road|service|track)$')
self.re_0b27200b = re.compile(r'(?i)^s(\.|-| )?\/?n\.?º?$')
self.re_0db5b64e = re.compile(r'village|town|city')
self.re_1054eb5a = re.compile(r'bridleway|bus_stop|cycleway|crossing|footway|give_way|motorway_junction|path|raceway|rest_area|services|speed_camera|steps|stop')
self.re_10f1c360 = re.compile(r'(,|( |-) ?[A-Z]{2})')
self.re_126ba9a9 = re.compile(r'(?i)^Borrach(aria|eiro)')
self.re_12b48afb = re.compile(r'^(grassland|heath|scrub|wood)$')
self.re_131cc885 = re.compile(r' ou ')
self.re_139e342b = re.compile(r'(?i)^Helipo(n|r)to.*')
self.re_13f4c147 = re.compile(r'(?i)(?u)^paço\b')
self.re_152c10ee = re.compile(r'hamlet|isolated_dwelling|town|village')
self.re_15690541 = re.compile(r'^(?i)estrada de ferro')
self.re_160d1bfc = re.compile(r'^(?i)creche\b')
self.re_178f5446 = re.compile(r'(?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)\.? .*')
self.re_17fd35b3 = re.compile(r'^pt:')
self.re_1b6eb989 = re.compile(r'^(fine_gravel|gravel|pebbles|pebblestone|sand|shells|shingle|stones)$')
self.re_1d232d4c = re.compile(r'^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b')
self.re_20188fb1 = re.compile(r'^[0-9]+( |-)*([A-Z])?$')
self.re_20c7dd98 = re.compile(r'^(?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(r'^(?i)(?u)(alameda|avenida|beco|estrada|ladeira|rodovia|rotatória|rua|travessa|trevo|viela) .*')
self.re_20fc5143 = re.compile(r'^(?i)Bairro\b')
self.re_243f4993 = re.compile(r'^(\+55|0800)')
self.re_280004fd = re.compile(r'^(Água|Arroio|Cabeceira|Córrego|Furo|Grota|Igarapé|Lajeado|Paraná|Restinga|Riacho|Ribeirão|Rio|Sanga)\b')
self.re_292e0bb5 = re.compile(r'(?i)\b[0-9]+ ?m?\b')
self.re_2cd1e949 = re.compile(r'^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)')
self.re_2dbaea13 = re.compile(r'^(?i)\bSAMU\b')
self.re_2e8e4f2b = re.compile(r'(?i)google')
self.re_2fcb6bab = re.compile(r'^(?i)ciclovia .*')
self.re_2ffc377d = re.compile(r'.* D(a|e|o)s? .*')
self.re_31732cd0 = re.compile(r'(?i)(?u)^(Brasilg(á|a)s|Consigaz|Copagaz|Liquig(á|a)s|Minasg(á|a)s|Nacional G(á|a)s|Supergasbras|Ultragaz)$')
self.re_3570fd42 = re.compile(r'(?i)\bAPA\b')
self.re_35bb0f2f = re.compile(r'^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b')
self.re_362f879f = re.compile(r'college|school')
self.re_375e3de4 = re.compile(r'.*([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}).*')
self.re_38a8f0ff = re.compile(r'^(?i)(?u)edifício.*')
self.re_39d67968 = re.compile(r'^[a-z].*')
self.re_3aeda39d = re.compile(r'hamlet|island|isolated_dwelling|neighbourhood|suburb|village')
self.re_3b304b9b = re.compile(r'(?i)(?u)\b(Centro Paula Souza|Escola Técnica|ETEC)\b')
self.re_3eb0ab44 = re.compile(r'clinic|doctors|hospital')
self.re_408831d0 = re.compile(r'^(br|bR|Br)[0-9]{14}$')
self.re_46ab4d8d = re.compile(r'^(?i)(?u)c(â|a)mara\b')
self.re_4a8ca94e = re.compile(r'^(?i)(?u)praça.*')
self.re_4bd3b925 = re.compile(r'^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$')
self.re_4cf86823 = re.compile(r'(?i)\bsaude\b')
self.re_509425de = re.compile(r'(?i)(?u)\bAPA\b|Área de Proteção Ambiental')
self.re_524288b6 = re.compile(r'^BR[0-9]{14}$')
self.re_52ab3b8b = re.compile(r'^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$')
self.re_53abc074 = re.compile(r'^(give_way|mini_roundabout|stop|turning_circle)$')
self.re_568a42f4 = re.compile(r'\b[A-Z]{2,4} (- )?[0-9]{2,3}\b')
self.re_57b8ef8e = re.compile(r'_[0-9]$')
self.re_57bee688 = re.compile(r'^[0-9]{5}( |\.)[0-9]{3}$')
self.re_5849be19 = re.compile(r'^(?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(r'^(city_block|farm|hamlet|island|islet|isolated_dwelling|neighbourhood|square)$')
self.re_591572a5 = re.compile(r'city|hamlet|isolated_dwelling|village')
self.re_5ab76b11 = re.compile(r'^(clinic|doctors|hospital)$')
self.re_5ac7053e = re.compile(r'^(1(a|b)?|[1-9][0-9]?)$')
self.re_5cd37790 = re.compile(r'(?i)^motel\b')
self.re_5d3348cb = re.compile(r'city|farm|neighbourhood|suburb|town|village')
self.re_5ddbb7eb = re.compile(r'^[0-9]{2}\.[0-9]{3}\.[0-9]{3}\/[0-9]{4}-[0-9]{2}$')
self.re_6024a566 = re.compile(r'(?i)^Aer(ódromo|oporto) de.*')
self.re_604bb645 = re.compile(r'(?i)(?u)\b(Ale|BR|Esso|Ipiranga|Petrobr(á|a)s|Shell|Texaco)\b')
self.re_60ad6838 = re.compile(r'^(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(r'^(island|islet)$')
self.re_64387998 = re.compile(r'^(?i)Bairro d(a|e|o)s?\b')
self.re_6566db6a = re.compile(r'(?i).*heliport$')
self.re_65710fdb = re.compile(r'(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)')
self.re_667ce569 = re.compile(r'^(?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(r'^[0-9]+0$')
self.re_6b6e390d = re.compile(r'(Alameda|Avenida|Rua|Travessa|Viela) .*')
self.re_6bf570a0 = re.compile(r'^(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(r'school|university')
self.re_6e34cd0f = re.compile(r'(?i)\bcoreto\b')
self.re_6efb8049 = re.compile(r'(?i).*airport$')
self.re_72d45155 = re.compile(r'route|street')
self.re_7633bf4e = re.compile(r'Rodovia ([A-Z]{2,3}-[0-9]{2,4})')
self.re_793b22ec = re.compile(r'^(?i)(?u)c((â|a)me|ama)ra\b')
self.re_7a246e93 = re.compile(r'^(100|18{0,1}|19[0-9])$')
self.re_7a5b2736 = re.compile(r'\.')
self.re_7afc6883 = re.compile(r'^[A-Z]{4}$')
self.re_7b7c453d = re.compile(r'^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*')
self.re_7ec1fb9a = re.compile(r'(?i)^prefeitura\b')
self.re_7f53e992 = re.compile(r'^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$')
def node(self, data, tags):
capture_tags = {}
keys = tags.keys()
err = []
# *["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 ('addr:street' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'addr:street')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 1, self.re_6bf570a0, '^(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) .*'), mapcss._tag_capture(capture_tags, 1, tags, 'addr:street'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# group:tr("Brasil - Verificar")
# throwWarning:tr("{0} com logradouro ausente, errado ou abreviado","{0.key}")
err.append({'class': 9018002, 'subclass': 279840772, 'text': mapcss.tr('{0} com logradouro ausente, errado ou abreviado', mapcss._tag_uncapture(capture_tags, '{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/][inside("BR")]
if ('name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((not mapcss._tag_capture(capture_tags, 0, tags, 'highway')) and (mapcss._tag_capture(capture_tags, 1, tags, 'route') != mapcss._value_const_capture(capture_tags, 1, 'road', 'road')) and (not mapcss._tag_capture(capture_tags, 2, tags, 'public_transport')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 3, self.re_72d45155, 'route|street'), mapcss._tag_capture(capture_tags, 3, tags, 'type'))) and (mapcss._tag_capture(capture_tags, 4, tags, 'name')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_5849be19), mapcss._tag_capture(capture_tags, 5, tags, 'name'))) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 6, self.re_15690541, '^(?i)estrada de ferro'), mapcss._tag_capture(capture_tags, 6, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 535280341, 'text': mapcss.tr('objeto com nome de via mas sem tag de {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# *[name=~/^(?i)(?u)[a-z0-9]+_([a-z0-9]_?)+$/][inside("BR")]
if ('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, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1476954926, 'text': mapcss.tr('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)\.? .*/][inside("BR")]
if ('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, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("palavra abreviada em {0}","{0.key}")
err.append({'class': 9018003, 'subclass': 749019091, 'text': mapcss.tr('palavra abreviada em {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# *[leisure][name=~/^(?i)(?u)(campo|est(á|a)dio|gin(á|a)sio|quadra)( de (futebol|esportes?))?$/][inside("BR")]
if ('leisure' in keys and 'name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'leisure')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7f53e992), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("nome supérfluo/incompleto de local de lazer")
err.append({'class': 9018004, 'subclass': 1485441713, 'text': mapcss.tr('nome supérfluo/incompleto de local de lazer')})
# *[name=~/^(?i)(?u)((Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF|hospital)$/][inside("BR")]
if ('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, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("nome supérfluo/incompleto de local de saúde")
err.append({'class': 9018005, 'subclass': 1497769259, 'text': mapcss.tr('nome supérfluo/incompleto de local de saúde')})
# *[amenity=~/^(clinic|doctors|hospital)$/][name=~/(?i)\bsaude\b/][inside("BR")]
if ('amenity' in keys and '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, 'amenity'))) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4cf86823), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# group:tr("Brasil - Verificar")
# throwWarning:tr("erro de ortografia em ''saúde''")
err.append({'class': 9018002, 'subclass': 1962359328, 'text': mapcss.tr('erro de ortografia em \'\'saúde\'\'')})
# *[place=farm][name^="Sitio "][inside("BR")]
if ('name' in keys and 'place' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place') == mapcss._value_capture(capture_tags, 0, 'farm')) and (mapcss.startswith(mapcss._tag_capture(capture_tags, 1, tags, 'name'), mapcss._value_capture(capture_tags, 1, 'Sitio '))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# group:tr("Brasil - Verificar")
# throwWarning:tr("faltando acento em ''Sítio''")
err.append({'class': 9018002, 'subclass': 653860263, 'text': mapcss.tr('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)$/][inside("BR")]
if ('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, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1104230922, 'text': mapcss.tr('local com nome supérfluo, incompleto ou descritivo')})
# *[amenity=parking][name=~/(?i)^Estacionamento /][inside("BR")]
# Rule Blacklisted (id: 1322492249)
# *[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 ('designation' in keys) or ('name' in keys) or ('ref' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'designation') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'addr:housename'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'designation'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'ref') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'old_ref'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'addr:housename'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'designation'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'alt_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'int_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'loc_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'nat_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'official_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'old_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'reg_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'short_name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'name') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'sorting_name'))) and (mapcss.inside(self.father.config.options, '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': 2003922, 'text': mapcss.tr('{0} e {1} são iguais; remover chave {1} desnecessária', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{0.value}')), 'allow_fix_override': True, 'fix': {
'-': ([
mapcss._tag_uncapture(capture_tags, '{0.value}')])
}})
# *[source=*name][inside("BR")]
if ('source' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'source') == mapcss._value_capture(capture_tags, 0, mapcss.tag(tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 470146003, 'text': mapcss.tr('{0} e {1} são iguais', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{0.value}'))})
# *[name=~/(?i)(?u)((sem (denomina(ç|c)(ã|a)o|nome|sa(i|í)da))|desconhecido|n(ã|a)o conhecido)/][inside("BR")]
if ('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, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("objeto com nomenclatura incorreta")
# suggestAlternative:"noname"
err.append({'class': 9018007, 'subclass': 1272098213, 'text': mapcss.tr('objeto com nomenclatura incorreta')})
# node[maxheight][barrier!=height_restrictor][!traffic_sign][inside("BR")]
# node[maxspeed][highway!=speed_camera][!traffic_sign][inside("BR")]
if ('maxheight' in keys) or ('maxspeed' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'maxheight')) and (mapcss._tag_capture(capture_tags, 1, tags, 'barrier') != mapcss._value_const_capture(capture_tags, 1, 'height_restrictor', 'height_restrictor')) and (not mapcss._tag_capture(capture_tags, 2, tags, 'traffic_sign')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'maxspeed')) and (mapcss._tag_capture(capture_tags, 1, tags, 'highway') != mapcss._value_const_capture(capture_tags, 1, 'speed_camera', 'speed_camera')) and (not mapcss._tag_capture(capture_tags, 2, tags, 'traffic_sign')) and (mapcss.inside(self.father.config.options, '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': 427326608, 'text': mapcss.tr('{0} não deve ser utilizado em nó; utilizar a restrição na via', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# node[noname?][inside("BR")]
if ('noname' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'noname') in ('yes', 'true', '1')) and (mapcss.inside(self.father.config.options, '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': 1940682714, 'text': mapcss.tr('uso suspeito de {0} em nó', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# *[designation][inside("BR")]
if ('designation' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'designation')) and (mapcss.inside(self.father.config.options, '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': 1818234763, 'text': mapcss.tr('{0} é uma chave utilizada apenas no Reino Unido', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# node[highway=motorway_junction][!name][!ref][inside("BR")]
if ('highway' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'highway') == mapcss._value_capture(capture_tags, 0, 'motorway_junction')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'name')) and (not mapcss._tag_capture(capture_tags, 2, tags, 'ref')) and (mapcss.inside(self.father.config.options, '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': 1629006877, 'text': mapcss.tr('{0} sem pelo menos uma das tags: {1} ou {2}', mapcss._tag_uncapture(capture_tags, '{0.value}'), mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{2.key}'))})
# *[place=~/hamlet|isolated_dwelling|town|village/][population>=100000][inside("BR")]
if ('place' in keys and '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, 'place'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'population') >= mapcss._value_capture(capture_tags, 1, 100000)) and (mapcss.inside(self.father.config.options, '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': 1009134521, 'text': mapcss.tr('local com 100.000 habitantes ou mais deve ser classificado como city'), 'allow_fix_override': True, 'fix': {
'+': dict([
['place','city']])
}})
# *[place=~/city|hamlet|isolated_dwelling|village/][population>=10000][population<100000][inside("BR")]
if ('place' in keys and '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, 'place'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'population') >= mapcss._value_capture(capture_tags, 1, 10000)) and (mapcss._tag_capture(capture_tags, 2, tags, 'population') < mapcss._value_capture(capture_tags, 2, 100000)) and (mapcss.inside(self.father.config.options, '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': 1343568198, 'text': mapcss.tr('local com população entre 10.000 e 100.000 deve ser classificado como town'), 'allow_fix_override': True, 'fix': {
'+': dict([
['place','town']])
}})
# *[place][place!~/hamlet|island|isolated_dwelling|neighbourhood|suburb|village/][population<10000][inside("BR")]
if ('place' in keys and 'population' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 1, self.re_3aeda39d, 'hamlet|island|isolated_dwelling|neighbourhood|suburb|village'), mapcss._tag_capture(capture_tags, 1, tags, 'place'))) and (mapcss._tag_capture(capture_tags, 2, tags, 'population') < mapcss._value_capture(capture_tags, 2, 10000)) and (mapcss.inside(self.father.config.options, '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': 409005616, 'text': mapcss.tr('local com menos de 10.000 habitantes deve ser classificado como village'), 'allow_fix_override': True, 'fix': {
'+': dict([
['place','village']])
}})
# *[place=city][!population][inside("BR")]
# *[place=town][!population][inside("BR")]
# *[place=village][!population][inside("BR")]
# Rule Blacklisted (id: 339470124)
# *[place=city][!name][inside("BR")]
# *[place=town][!name][inside("BR")]
# *[place=village][!name][inside("BR")]
if ('place' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place') == mapcss._value_capture(capture_tags, 0, 'city')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'name')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place') == mapcss._value_capture(capture_tags, 0, 'town')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'name')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place') == mapcss._value_capture(capture_tags, 0, 'village')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'name')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("{0} sem nome","{0.value}")
err.append({'class': 9018012, 'subclass': 1473808194, 'text': mapcss.tr('{0} sem nome', mapcss._tag_uncapture(capture_tags, '{0.value}'))})
# node[place=~/village|town|city/]["addr:city"=*name][inside("BR")]
# node[place=suburb]["addr:suburb"=*name][inside("BR")]
if ('addr:city' in keys and 'place' in keys) or ('addr:suburb' in keys and '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, 'place'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'addr:city') == mapcss._value_capture(capture_tags, 1, mapcss.tag(tags, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place') == mapcss._value_capture(capture_tags, 0, 'suburb')) and (mapcss._tag_capture(capture_tags, 1, tags, 'addr:suburb') == mapcss._value_capture(capture_tags, 1, mapcss.tag(tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 992485850, 'text': mapcss.tr('não deve possuir {0}', mapcss._tag_uncapture(capture_tags, '{1.key}')), 'allow_fix_override': True, 'fix': {
'-': ([
mapcss._tag_uncapture(capture_tags, '{1.key}')])
}})
# *["addr:city"=~/(,|( |-) ?[A-Z]{2})/][inside("BR")]
if ('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, 'addr:city'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("{0} deve conter apenas o nome da cidade","{0.key}")
err.append({'class': 9018013, 'subclass': 1479274467, 'text': mapcss.tr('{0} deve conter apenas o nome da cidade', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# *[name=~/^(?i)(?u)(Faz\.|Fazenda|Sítio|Chácara)/][place][place!~/city|farm|neighbourhood|suburb|town|village/][inside("BR")]
if ('name' in keys and '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, 'name'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'place')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_5d3348cb, 'city|farm|neighbourhood|suburb|town|village'), mapcss._tag_capture(capture_tags, 2, tags, 'place'))) and (mapcss.inside(self.father.config.options, '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': 337742963, 'text': mapcss.tr('objeto talvez deva ser {0}=farm', mapcss._tag_uncapture(capture_tags, '{1.key}'))})
# *[place][name=~/^(?i)Bairro\b/][name!~/^(?i)Bairro d(a|e|o)s?\b/][inside("BR")]
if ('name' in keys and 'place' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'place')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_20fc5143), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_64387998, '^(?i)Bairro d(a|e|o)s?\\b'), mapcss._tag_capture(capture_tags, 2, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1441242115, 'text': mapcss.tr('objeto talvez não deva ter \'\'Bairro\'\' no nome')})
# node[place=~/^(island|islet)$/][inside("BR")]
if ('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, 'place'))) and (mapcss.inside(self.father.config.options, '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': 820669758, 'text': mapcss.tr('representar a ilha, se possível, como uma área')})
# *[iata="0"][inside("BR")]
if ('iata' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'iata') == mapcss._value_capture(capture_tags, 0, '0')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("{0} com valor = {1}","{0.key}","{0.value}")
err.append({'class': 9018014, 'subclass': 1098244333, 'text': mapcss.tr('{0} com valor = {1}', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{0.value}'))})
# *[amenity=~/college|school/][name=~/^(?i)(?u)(Centro Universitário|Faculdades?|FATEC|Instituto Federal)\b/][inside("BR")]
if ('amenity' in keys and '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, 'amenity'))) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1d232d4c), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1605707172, 'text': mapcss.tr('estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss._tag_uncapture(capture_tags, '{0.key}=university')).split('=', 1)])
}})
# *[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 ('amenity' in keys and 'name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'amenity') == mapcss._value_capture(capture_tags, 0, 'school')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_044c8944), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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, 'amenity'))) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b304b9b), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1282773099, 'text': mapcss.tr('estabelecimento de ensino classificado incorretamente'), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss._tag_uncapture(capture_tags, '{0.key}=college')).split('=', 1)])
}})
# *[amenity=school][name=~/^(?i)(?u)(auto(-| )?( moto )?escola|centro de formação de condutores|cfc|moto escola)\b/][inside("BR")]
if ('amenity' in keys and 'name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'amenity') == mapcss._value_capture(capture_tags, 0, 'school')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_35bb0f2f), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 566309924, 'text': mapcss.tr('autoescola classificada incorretamente'), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss._tag_uncapture(capture_tags, '{0.key}=driving_school')).split('=', 1)])
}})
# *[amenity=school][name=~/^(?i)creche\b/][inside("BR")]
if ('amenity' in keys and 'name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'amenity') == mapcss._value_capture(capture_tags, 0, 'school')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_160d1bfc), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1847987722, 'text': mapcss.tr('creche classificada incorretamente'), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss._tag_uncapture(capture_tags, '{0.key}=kindergarten')).split('=', 1)])
}})
# *[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 (id: 1123790420)
# *[name=~/^(?i)(?u)(AM(A|E)|(Posto|Unidade (Básica)?) de Sa(u|ú)de|UBS|PSF).*/][amenity=hospital][inside("BR")]
if ('amenity' in keys and '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, 'name'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'amenity') == mapcss._value_capture(capture_tags, 1, 'hospital')) and (mapcss.inside(self.father.config.options, '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")
# fixAdd:"amenity=clinic"
err.append({'class': 9018006, 'subclass': 74419437, 'text': mapcss.tr('postos/unidades de saúde devem ser amenity=clinic'), 'allow_fix_override': True, 'fix': {
'+': dict([
['amenity','clinic']])
}})
# *[name=~/^(?i)\bSAMU\b/][amenity=~/clinic|doctors|hospital/][inside("BR")]
if ('amenity' in keys and '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, 'name'))) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3eb0ab44), mapcss._tag_capture(capture_tags, 1, tags, 'amenity'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("SAMU classificado de forma errada")
# suggestAlternative:"emergency=ambulance_station"
err.append({'class': 9018016, 'subclass': 392029310, 'text': mapcss.tr('SAMU classificado de forma errada')})
# node[highway=~/^(give_way|mini_roundabout|stop|turning_circle)$/][name][inside("BR")]
if ('highway' in keys and '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, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'name')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("objeto não deve possuir {0}","{1.key}")
err.append({'class': 9018017, 'subclass': 1025728334, 'text': mapcss.tr('objeto não deve possuir {0}', mapcss._tag_uncapture(capture_tags, '{1.key}'))})
# node[highway=speed_camera][!maxspeed][inside("BR")]
if ('highway' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'highway') == mapcss._value_capture(capture_tags, 0, 'speed_camera')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'maxspeed')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("adicionar {0} ao {1}","{1.key}","{0.tag}")
err.append({'class': 9018018, 'subclass': 1228671542, 'text': mapcss.tr('adicionar {0} ao {1}', mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{0.tag}'))})
# *[crossing][!highway][!railway][inside("BR")]
if ('crossing' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'crossing')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'highway')) and (not mapcss._tag_capture(capture_tags, 2, tags, 'railway')) and (mapcss.inside(self.father.config.options, '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': 2098306424, 'text': mapcss.tr('{0} deve ser utilizado com {1}={0} ou {2}={0}', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{2.key}'))})
# *[aeroway][designation=~/^[A-Z]{4}$/][!icao][inside("BR")]
# *[aeroway][ref=~/^[A-Z]{4}$/][!icao][inside("BR")]
if ('aeroway' in keys and 'designation' in keys) or ('aeroway' in keys and 'ref' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, 'designation'))) and (not mapcss._tag_capture(capture_tags, 2, tags, 'icao')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7afc6883), mapcss._tag_capture(capture_tags, 1, tags, 'ref'))) and (not mapcss._tag_capture(capture_tags, 2, tags, 'icao')) and (mapcss.inside(self.father.config.options, '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': 619372172, 'text': mapcss.tr('{0} provavelmente deve ser utilizado como {1}', mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{2.key}')), 'allow_fix_override': True, 'fix': {
'+': dict([
[(mapcss._tag_uncapture(capture_tags, '{1.key} => {2.key}')).split('=>', 1)[1].strip(), mapcss.tag(tags, (mapcss._tag_uncapture(capture_tags, '{1.key} => {2.key}')).split('=>', 1)[0].strip())]]),
'-': ([
(mapcss._tag_uncapture(capture_tags, '{1.key} => {2.key}')).split('=>', 1)[0].strip()])
}})
# *[access=permissive][inside("BR")]
if ('access' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'access') == mapcss._value_capture(capture_tags, 0, 'permissive')) and (mapcss.inside(self.father.config.options, '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': 1240816112, 'text': mapcss.tr('{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, '{0.tag}'))})
# *[name=~/^(?U)(\p{Upper}| )+$/][inside("BR")]
# *["addr:street"=~/^(?U)(\p{Upper}| )+$/][inside("BR")]
# Rule Blacklisted (id: 951501764)
# *["addr:postcode"=~/^[0-9]{8}$/][inside("BR")]
# Rule Blacklisted (id: 1948798798)
# *[postal_code=~/^[0-9]{8}$/][inside("BR")]
# Rule Blacklisted (id: 733725137)
# *["addr:postcode"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")]
if ('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, 'addr:postcode'))) and (mapcss.inside(self.father.config.options, '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': 1667206075, 'text': mapcss.tr('formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss.concat('addr:postcode=', mapcss.replace(mapcss.replace(mapcss.tag(tags, 'addr:postcode'), ' ', '-'), '.', '-'))).split('=', 1)])
}})
# *["postal_code"=~/^[0-9]{5}( |\.)[0-9]{3}$/][inside("BR")]
if ('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, 'postal_code'))) and (mapcss.inside(self.father.config.options, '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': 1977906896, 'text': mapcss.tr('formato do CEP pode ser melhorado'), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss.concat('postal_code=', mapcss.replace(mapcss.replace(mapcss.tag(tags, 'postal_code'), ' ', '-'), '.', '-'))).split('=', 1)])
}})
# *["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 (id: 2074305530)
# *[alt_source][source][inside("BR")]
if ('alt_source' in keys and 'source' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'alt_source')) and (mapcss._tag_capture(capture_tags, 1, tags, 'source')) and (mapcss.inside(self.father.config.options, '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': 472956812, 'text': mapcss.tr('{0} deve estar incluído em {1}, separado por \'\';\'\' caso necessário', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{1.key}'))})
# *[landuse?][inside("BR")]
if ('landuse' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'landuse') in ('yes', 'true', '1')) and (mapcss.inside(self.father.config.options, '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': 6418462, 'text': mapcss.tr('especificar valor correto para {0} ao invés de \'\'{1}\'\'', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss.tag(tags, 'landuse'))})
# *[long_name][inside("BR")]
if ('long_name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'long_name')) and (mapcss.inside(self.father.config.options, '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': 1737555221, 'text': mapcss.tr('chave inválida: {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# *["building:levels"<1][inside("BR")]
if ('building:levels' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'building:levels') < mapcss._value_capture(capture_tags, 0, 1)) and (mapcss.inside(self.father.config.options, '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': 775859422, 'text': mapcss.tr('{0} com valor inválido', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# *[hires?][inside("BR")]
if ('hires' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'hires') in ('yes', 'true', '1')) and (mapcss.inside(self.father.config.options, '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': 895278192, 'text': mapcss.tr('não se deve utilizar {0} para demarcar áreas de cobertura de imagem', mapcss._tag_uncapture(capture_tags, '{0.key}'))})
# node[man_made=tower]["tower:type"=lighting][inside("BR")]
if ('man_made' in keys and 'tower:type' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'man_made') == mapcss._value_capture(capture_tags, 0, 'tower')) and (mapcss._tag_capture(capture_tags, 1, tags, 'tower:type') == mapcss._value_capture(capture_tags, 1, 'lighting')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# throwWarning:tr("uso incorreto de {0}","{0.tag}")
# suggestAlternative:"man_made=mast"
# fixAdd:"man_made=mast"
err.append({'class': 9018064, 'subclass': 865785, 'text': mapcss.tr('uso incorreto de {0}', mapcss._tag_uncapture(capture_tags, '{0.tag}')), 'allow_fix_override': True, 'fix': {
'+': dict([
['man_made','mast']])
}})
# *[tourism=motel][amenity!=love_hotel][inside("BR")]
# *[name=~/(?i)\bmotel\b/][amenity!=love_hotel][inside("BR")]
if ('name' in keys) or ('tourism' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'tourism') == mapcss._value_capture(capture_tags, 0, 'motel')) and (mapcss._tag_capture(capture_tags, 1, tags, 'amenity') != mapcss._value_const_capture(capture_tags, 1, 'love_hotel', 'love_hotel')) and (mapcss.inside(self.father.config.options, '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, 'name'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'amenity') != mapcss._value_const_capture(capture_tags, 1, 'love_hotel', 'love_hotel')) and (mapcss.inside(self.father.config.options, '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': 1987370859, 'text': mapcss.tr('ausência de tag \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, '{1.value}')), 'allow_fix_override': True, 'fix': {
'+': dict([
(mapcss._tag_uncapture(capture_tags, '{1.key}={1.value}')).split('=', 1)])
}})
# *[amenity=love_hotel][tourism][tourism!=motel][inside("BR")]
if ('amenity' in keys and 'tourism' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'amenity') == mapcss._value_capture(capture_tags, 0, 'love_hotel')) and (mapcss._tag_capture(capture_tags, 1, tags, 'tourism')) and (mapcss._tag_capture(capture_tags, 2, tags, 'tourism') != mapcss._value_const_capture(capture_tags, 2, 'motel', 'motel')) and (mapcss.inside(self.father.config.options, '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': 1760828878, 'text': mapcss.tr('provavelmente deve ser \'\'{0}={1}\'\'', mapcss._tag_uncapture(capture_tags, '{2.key}'), mapcss._tag_uncapture(capture_tags, '{2.value}'))})
# *[name=~/(?i)^motel\b/][tourism!=motel][inside("BR")]
if ('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, 'name'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'tourism') != mapcss._value_const_capture(capture_tags, 1, 'motel', 'motel')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match:
# group:tr("Brasil - Verificar")
# throwWarning:tr("motel classificado incorretamente")
# suggestAlternative:"tourism=motel"
err.append({'class': 9018002, 'subclass': 1456128106, 'text': mapcss.tr('motel classificado incorretamente')})
# *[aeroway=aerodrome][name=~/(?i).*airport$/][inside("BR")]
# *[aeroway=helipad][name=~/(?i).*heliport$/][inside("BR")]
if ('aeroway' in keys and 'name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway') == mapcss._value_capture(capture_tags, 0, 'aerodrome')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6efb8049), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway') == mapcss._value_capture(capture_tags, 0, 'helipad')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6566db6a), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 1743601177, 'text': mapcss.tr('{0} com nome em inglês', mapcss._tag_uncapture(capture_tags, '{0.tag}'))})
# *[aeroway=aerodrome][name=~/(?i)^Aer(ódromo|oporto) de.*/][inside("BR")]
# *[aeroway=helipad][name=~/(?i)^Helipo(n|r)to.*/][inside("BR")]
if ('aeroway' in keys and 'name' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway') == mapcss._value_capture(capture_tags, 0, 'aerodrome')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6024a566), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway') == mapcss._value_capture(capture_tags, 0, 'helipad')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_139e342b), mapcss._tag_capture(capture_tags, 1, tags, 'name'))) and (mapcss.inside(self.father.config.options, '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': 136467214, 'text': mapcss.tr('conferir se existe nome oficial do {0}', mapcss._tag_uncapture(capture_tags, '{0.value}'))})
# *[aeroway=aerodrome][ref][inside("BR")]
if ('aeroway' in keys and 'ref' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'aeroway') == mapcss._value_capture(capture_tags, 0, 'aerodrome')) and (mapcss._tag_capture(capture_tags, 1, tags, 'ref')) and (mapcss.inside(self.father.config.options, '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': 1633437696, 'text': mapcss.tr('\'\'{0}\'\' não faz sentido em aeroporto', mapcss._tag_uncapture(capture_tags, '{1.key}'))})
# node[surface][!traffic_calming][inside("BR")]
# Rule Blacklisted (id: 282605167)
# *[waterway][layer<0][!tunnel][inside("BR")]
if ('layer' in keys and 'waterway' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'waterway')) and (mapcss._tag_capture(capture_tags, 1, tags, 'layer') < mapcss._value_capture(capture_tags, 1, 0)) and (not mapcss._tag_capture(capture_tags, 2, tags, 'tunnel')) and (mapcss.inside(self.father.config.options, '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': 203420779, 'text': mapcss.tr('{0} negativo de {1} com ausência de {2}', mapcss._tag_uncapture(capture_tags, '{1.key}'), mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{2.key}'))})
# *[waterway][layer>0][!bridge][inside("BR")]
if ('layer' in keys and 'waterway' in keys):
match = False
if not match:
capture_tags = {}
try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'waterway')) and (mapcss._tag_capture(capture_tags, 1, tags, 'layer') > mapcss._value_capture(capture_tags, 1, 0)) and (not mapcss._tag_capture(capture_tags, 2, tags, 'bridge')) and (mapcss.inside(self.father.config.options, 'BR')))
except mapcss.RuleAbort: pass
if match: