-
Notifications
You must be signed in to change notification settings - Fork 3
/
staging.validator.mapcss
179 lines (148 loc) · 6.49 KB
/
staging.validator.mapcss
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
meta
{
title: "Staging rules Brazil";
version: "2018-11-30";
description: "Staging rules for Brazil. It will eat your food. Messages are in Portuguese only.";
author: "OpenStreetMap Brasil";
watch-modified: true;
}
/* acesso à Internet deve fazer parte de algum estabelecimento/local */
/* http://overpass-turbo.eu/s/8PJ */
*[internet_access][!leisure][!building][!office][!amenity][!tourism][!shop] {
throwWarning: tr("{0} deve estar associado a um local", "{0.key}");
}
/* wheelchair deve fazer parte de algum estabelecimento/local */
/* http://overpass-turbo.eu/s/8PL */
*[wheelchair][!highway][!man_made][!leisure][!building][!office][!amenity][!tourism][!shop] {
throwWarning: tr("{0} deve estar associado a um local", "{0.key}");
}
*[name =~ /^(?U)(\p{Lower}| )+$/] {
throwWarning: tr("{0} totalmente em minúsculo", "{0.key}");
group: tr("Brasil - Verificar");
}
/* áreas residenciais muito grandes que podem indicar uso incorreto como delimitador de cidade */
/* http://overpass-turbo.eu/s/9pM */
area[landuse=residential][name !~ /(?i)(?u)(habitacional|condomínio|residencial)/][!barrier][eval(areasize()) > 200000] {
throwWarning: tr("área residencial muito grande");
group: tr("Brasil - Verificar");
}
way[highway $= _link][eval(waylength()) > 250] {
throwWarning: tr("{0} com comprimento muito grande", tag("highway"));
group: tr("Brasil - Verificar");
}
way[highway][junction = roundabout][eval(waylength()) < 30]:closed {
throwWarning: tr("{0} com comprimento pequeno", "{1.tag}");
suggestAlternative: "highway=mini_roundabout";
suggestAlternative: "highway=turning_circle";
suggestAlternative: "highway=turning_loop";
group: tr("Brasil - Verificar");
}
/* rest_area com fuel dentro deve ser services */
/* http://overpass-turbo.eu/s/qLZ */
*[amenity = fuel] ∈ *[highway = rest_area] {
throwWarning: tr("{0} incorreto", "{0.tag}");
suggestAlternative: "highway=services";
group: tr("Brasil - Verificar");
}
/* --> issue #77 */
area[admin_level =~ /^(8|9)$/][place],
area[admin_level][population] {
throwError: tr("limite não deve possuir {0}", "{1.key}");
}
area[place =~ /^(neighbourhood|suburb)$/][admin_level][admin_level != 10] {
throwError: tr("local com {0} ou {1} errado", "{0.key}", "{1.key}");
}
relation[admin_level = 10] >[role = admin_centre] node {
throwError: tr("bairro não deve possuir admin_centre");
suggestAlternative: "label";
}
/* issue #77 <-- */
*[amenity = bank][name =~ /(?i)(?u)\b(Banco do (Brasil|Nordeste)|Banespa|Banrisul|BB|Bradesco|Caixa|CEF|Citibank|HSBC|Ita(u|ú)|Mercantil|Santander|Sicoob|Sicredi)\b/],
*[atm][amenity != bank][name =~ /(?i)(?u)\b(Banco do (Brasil|Nordeste)|Banespa|Banrisul|BB|Bradesco|Caixa|CEF|Citibank|HSBC|Ita(u|ú)|Mercantil|Santander|Sicoob|Sicredi)\b/] {
throwWarning: tr("uso incorreto da marca/nome para {0}", "{0.tag}");
suggestAlternative: "brand";
group: tr("Brasil - Verificar");
}
way[highway] > node { set .is_in_highway; }
area[!highway] > node.is_in_highway {
throwWarning: tr("área conectada na rua");
}
node[tag("name") = parent_tag("name")] ∈ area:closed[name],
area[tag("name") = parent_tag("name")] ∈ area:closed[name] {
throwWarning: tr("objetos com o mesmo nome");
group: tr("Brasil - Verificar");
}
way[highway][name =~ /^(?i)(?u)\b(Avenida|Beco|Rua|Travessa|Viela)\b.*\b([A-Z]$|[0-9]+|Zero|Um|Dois|Três|Quatro|Cinco|Seis|Sete|Oito|Nove|Dez|Onze|Doze|Treze|Quatorze|Quinze|Dezesseis|Dezessete|Dezoito|Dezenove|Vinte|Trinta|Quarenta|Cinquenta|Sessenta|Setenta|Oitenta|Noventa|Cem|Duzentos|Trezentos|Quatrocentos|Quinhentos|Seiscentos|Setecentos|Oitocentos|Novecentos|Mil)\b/][name !~ /\bde\b|\./] {
throwWarning: tr("via com possível nome provisório - ver se existe nome mais atual");
group: tr("Brasil - Verificar");
}
way[power = line][voltage < 50000] {
throwWarning: tr("{0} is too low for {1}", "{1.key}", "{0.tag}");
suggestAlternative: "power=minor_line";
}
way[power = minor_line][voltage >= 50000] {
throwWarning: tr("{0} is too high for {1}", "{1.key}", "{0.tag}");
suggestAlternative: "power=line";
}
node[power = tower] < way[power = cable] {
throwWarning: tr("{0} should not be used with power=tower", "{0.tag}");
suggestAlternative: "power=line";
}
node[power = pole] < way[power = cable] {
throwWarning: tr("{0} should not be used with power=pole", "{0.tag}");
suggestAlternative: "power=minor_line";
}
node[power = pole] < way[power = line] {
throwWarning: tr("{0} should not be used with power=pole", "{0.tag}");
suggestAlternative: "power=tower";
suggestAlternative: "power=minor_line";
}
way[power = line] > node[man_made = tower] {
throwWarning: tr("wrong usage of {0}", "{0.tag}");
suggestAlternative: "power=tower";
}
way[power = minor_line] > node[man_made = tower] {
throwWarning: tr("wrong usage of {0}", "{0.tag}");
suggestAlternative: "power=tower";
suggestAlternative: "power=pole";
}
/* Both should start with a uppercase letter */
*[genus][genus !~ /^[A-Z][a-z]+$/],
*[species][species !~ /^[A-Z][a-z]+ [a-z]+$/] {
throwWarning: tr("{0} written in an inappropriate way", "{0.key}");
}
/* "genus" should be the same as the first part of "species" */
*[genus][species][tag(genus) != get(split(" ", tag(species)), 0)] {
throwWarning: tr("genus differs from species prefix");
}
*[genus][barrier != hedge][landuse !~ /^(forest|orchard|)$/][natural !~ /^(tree|tree_row|wetland|wood)$/],
*[species][barrier != hedge][landuse !~ /^(forest|orchard|plant_nursery)$/][natural !~ /^(tree|tree_row|wetland|wood)$/] {
throwWarning: tr("{0} without a proper feature", "{0.key}");
}
/* "trees" is used as refinement for trees or plants in landuse=orchard */
*[trees][landuse != orchard] {
throwWarning: tr("{0} should be used with landuse=orchard", "{0.key}");
}
way[place = island]!:closed,
way[place = islet]!:closed {
throwError: tr("área da ilha não está fechada");
}
area[tag("landuse") = parent_tag("landuse")] ∈ area[landuse] {
throwWarning: tr("{0} dentro de {1}", concat("landuse=", tag("landuse")), concat("landuse=", tag("landuse")));
}
*["wikipedia:pt"][!wikipedia][!"wikipedia:en"] {
throwWarning: tr("wikipedia:pt sem wikipedia");
fixAdd: concat("wikipedia=pt:", tag("wikipedia:pt"));
fixRemove: "wikipedia:pt";
}
*["wikipedia:pt"][!wikipedia]["wikipedia:en"],
*[wikipedia ^= "pt:"]["wikipedia:en"] {
throwWarning: tr("wikipedia:en desnecessário");
fixAdd: concat("wikipedia=pt:", tag("wikipedia:pt"));
fixRemove: "wikipedia:en";
fixRemove: "wikipedia:pt";
}
*[height =~ /^[0-9]+m$/] {
throwWarning: tr("valor de height pode ser melhorado");
fixAdd: concat("height=", replace(tag("height"), "m", " m"));
}