@@ -56,10 +56,10 @@ public List<OsmRelationInfo> preprocessOsmRelation(OsmElement.Relation relation)
56
56
public void processOsm (SourceFeature sf , FeatureCollector features ) {
57
57
if (sf .canBeLine () && sf .hasTag ("highway" ) &&
58
58
!(sf .hasTag ("highway" , "proposed" , "abandoned" , "razed" , "demolished" , "removed" , "construction" , "elevator" ))) {
59
- String kind = "other" ; //
60
- String kindDetail = "" ; //
61
- int minZoom = 15 ; //
62
- int maxZoom = 15 ; //
59
+ String kind = "other" ;
60
+ String kindDetail = "" ;
61
+ int minZoom = 15 ;
62
+ int maxZoom = 15 ;
63
63
int minZoomShieldText = 10 ;
64
64
int minZoomNames = 14 ;
65
65
@@ -96,8 +96,8 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
96
96
if (highway .equals ("motorway" ) || highway .equals ("motorway_link" )) {
97
97
// TODO: (nvkelso 20230622) Use Natural Earth for low zoom roads at zoom 5 and earlier
98
98
// as normally OSM roads would start at 6, but we start at 3 to match Protomaps v2
99
- kind = "highway" ; //
100
- minZoom = hasOverride ? 7 : 3 ; //
99
+ kind = "highway" ;
100
+ minZoom = hasOverride ? 7 : 3 ;
101
101
102
102
if (highway .equals ("motorway" )) {
103
103
minZoomShieldText = 7 ;
@@ -109,11 +109,11 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
109
109
} else if (highway .equals ("trunk" ) || highway .equals ("trunk_link" ) || highway .equals ("primary" ) ||
110
110
highway .equals ("primary_link" )) {
111
111
kind = "major_road" ;
112
- minZoom = 7 ; //
112
+ minZoom = 7 ;
113
113
114
114
if (highway .equals ("trunk" )) {
115
115
// Just trunk earlier zoom, otherwise road network looks choppy just with motorways then
116
- minZoom = hasOverride ? 7 : 6 ; //
116
+ minZoom = hasOverride ? 7 : 6 ;
117
117
minZoomShieldText = 8 ;
118
118
} else if (highway .equals ("primary" )) {
119
119
minZoomShieldText = 10 ;
@@ -126,8 +126,8 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
126
126
minZoomNames = 12 ;
127
127
} else if (highway .equals ("secondary" ) || highway .equals ("secondary_link" ) || highway .equals ("tertiary" ) ||
128
128
highway .equals ("tertiary_link" )) {
129
- kind = "major_road" ; //
130
- minZoom = 9 ; //
129
+ kind = "major_road" ;
130
+ minZoom = 9 ;
131
131
132
132
if (highway .equals ("secondary" )) {
133
133
minZoomShieldText = 11 ;
@@ -141,53 +141,53 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
141
141
}
142
142
} else if (highway .equals ("residential" ) || highway .equals ("service" ) || highway .equals ("unclassified" ) ||
143
143
highway .equals ("road" ) || highway .equals ("raceway" )) {
144
- kind = "minor_road" ; //
145
- minZoom = 12 ; //
144
+ kind = "minor_road" ;
145
+ minZoom = 12 ;
146
146
minZoomShieldText = 12 ;
147
147
minZoomNames = 14 ;
148
148
149
149
if (highway .equals ("service" )) {
150
- kindDetail = "service" ; //
151
- minZoom = 13 ; //
150
+ kindDetail = "service" ;
151
+ minZoom = 13 ;
152
152
153
153
// push down "alley", "driveway", "parking_aisle", "drive-through" & etc
154
154
if (sf .hasTag ("service" )) {
155
- minZoom = 14 ; //
156
- service = sf .getString ("service" ); //
155
+ minZoom = 14 ;
156
+ service = sf .getString ("service" );
157
157
}
158
158
}
159
159
} else if (sf .hasTag ("highway" , "pedestrian" , "track" , "path" , "cycleway" , "bridleway" , "footway" ,
160
160
"steps" , "corridor" )) {
161
- kind = "path" ; //
162
- kindDetail = highway ; //
163
- minZoom = 12 ; //
161
+ kind = "path" ;
162
+ kindDetail = highway ;
163
+ minZoom = 12 ;
164
164
minZoomShieldText = 12 ;
165
165
minZoomNames = 14 ;
166
166
167
167
if (sf .hasTag ("highway" , "path" , "cycleway" , "bridleway" , "footway" , "steps" )) {
168
- minZoom = 13 ; //
168
+ minZoom = 13 ;
169
169
}
170
170
if (sf .hasTag ("footway" , "sidewalk" , "crossing" )) {
171
- minZoom = 14 ; //
172
- kindDetail = sf .getString ("footway" , "" ); //
171
+ minZoom = 14 ;
172
+ kindDetail = sf .getString ("footway" , "" );
173
173
}
174
174
if (sf .hasTag ("highway" , "corridor" )) {
175
- minZoom = 14 ; //
175
+ minZoom = 14 ;
176
176
}
177
177
} else {
178
- kind = "other" ; //
179
- kindDetail = sf .getString ("service" , "" ); //
180
- minZoom = 14 ; //
178
+ kind = "other" ;
179
+ kindDetail = sf .getString ("service" , "" );
180
+ minZoom = 14 ;
181
181
minZoomShieldText = 14 ;
182
182
minZoomNames = 14 ;
183
183
}
184
184
185
185
if (hasOverride ) {
186
186
if (BRoad ) {
187
- minZoom = 6 ; //
187
+ minZoom = 6 ;
188
188
}
189
189
if (ARoad ) {
190
- minZoom = 3 ; //
190
+ minZoom = 3 ;
191
191
}
192
192
}
193
193
@@ -208,9 +208,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
208
208
.setZoomRange (minZoom , maxZoom );
209
209
210
210
if (!kindDetail .isEmpty ()) {
211
- feat .setAttr ("kind_detail" , kindDetail ); //
211
+ feat .setAttr ("kind_detail" , kindDetail );
212
212
} else {
213
- feat .setAttr ("kind_detail" , highway ); //
213
+ feat .setAttr ("kind_detail" , highway );
214
214
}
215
215
216
216
// Core OSM tags for different kinds of places
@@ -239,60 +239,60 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
239
239
240
240
// non-highway features
241
241
// todo: exclude railway stations, levels
242
- if (sf .canBeLine () && (sf .hasTag ("railway" ) || //
243
- sf .hasTag ("aerialway" , "cable_car" ) || //
244
- sf .hasTag ("man_made" , "pier" ) || //
245
- sf .hasTag ("route" , "ferry" ) || //
246
- sf .hasTag ("aeroway" , "runway" , "taxiway" )) && //
247
- (!sf .hasTag ("building" ) /* see https://github.com/protomaps/basemaps/issues/249 */ ) && //
248
- (!sf .hasTag ("railway" , "abandoned" , "razed" , "demolished" , "removed" , "construction" , "platform" , "proposed" ))) { //
242
+ if (sf .canBeLine () && (sf .hasTag ("railway" ) ||
243
+ sf .hasTag ("aerialway" , "cable_car" ) ||
244
+ sf .hasTag ("man_made" , "pier" ) ||
245
+ sf .hasTag ("route" , "ferry" ) ||
246
+ sf .hasTag ("aeroway" , "runway" , "taxiway" )) &&
247
+ (!sf .hasTag ("building" ) /* see https://github.com/protomaps/basemaps/issues/249 */ ) &&
248
+ (!sf .hasTag ("railway" , "abandoned" , "razed" , "demolished" , "removed" , "construction" , "platform" , "proposed" ))) {
249
249
250
250
int minZoom = 11 ;
251
251
252
252
if (sf .hasTag ("aeroway" , "runway" )) {
253
- minZoom = 9 ; //
253
+ minZoom = 9 ;
254
254
} else if (sf .hasTag ("aeroway" , "taxiway" )) {
255
- minZoom = 10 ; //
255
+ minZoom = 10 ;
256
256
} else if (sf .hasTag ("service" , "yard" , "siding" , "crossover" )) {
257
- minZoom = 13 ; //
257
+ minZoom = 13 ;
258
258
} else if (sf .hasTag ("man_made" , "pier" )) {
259
- minZoom = 13 ; //
259
+ minZoom = 13 ;
260
260
}
261
261
262
262
String kind = "other" ;
263
263
String kindDetail = "" ;
264
264
if (sf .hasTag ("aeroway" )) {
265
- kind = "aeroway" ; //
266
- kindDetail = sf .getString ("aeroway" ); //
265
+ kind = "aeroway" ;
266
+ kindDetail = sf .getString ("aeroway" );
267
267
} else if (sf .hasTag ("railway" , "disused" , "funicular" , "light_rail" , "miniature" , "monorail" , "narrow_gauge" ,
268
268
"preserved" , "subway" , "tram" )) {
269
- kind = "rail" ; //
270
- kindDetail = sf .getString ("railway" ); //
271
- minZoom = 14 ; //
269
+ kind = "rail" ;
270
+ kindDetail = sf .getString ("railway" );
271
+ minZoom = 14 ;
272
272
273
273
if (sf .hasTag ("railway" , "disused" )) {
274
- minZoom = 15 ; //
274
+ minZoom = 15 ;
275
275
}
276
276
} else if (sf .hasTag ("railway" )) {
277
- kind = "rail" ; //
278
- kindDetail = sf .getString ("railway" ); //
277
+ kind = "rail" ;
278
+ kindDetail = sf .getString ("railway" );
279
279
280
280
if (kindDetail .equals ("service" )) {
281
- minZoom = 13 ; //
281
+ minZoom = 13 ;
282
282
283
283
// eg a rail yard
284
284
if (sf .hasTag ("service" )) {
285
- minZoom = 14 ; //
285
+ minZoom = 14 ;
286
286
}
287
287
}
288
288
} else if (sf .hasTag ("route" , "ferry" )) {
289
- kind = "ferry" ; //
289
+ kind = "ferry" ;
290
290
} else if (sf .hasTag ("man_made" , "pier" )) {
291
- kind = "path" ; //
292
- kindDetail = "pier" ; //
291
+ kind = "path" ;
292
+ kindDetail = "pier" ;
293
293
} else if (sf .hasTag ("aerialway" )) {
294
- kind = "aerialway" ; //
295
- kindDetail = sf .getString ("aerialway" ); //
294
+ kind = "aerialway" ;
295
+ kindDetail = sf .getString ("aerialway" );
296
296
}
297
297
298
298
var feature = features .line (this .name ())
0 commit comments