Skip to content

Commit e4a41b9

Browse files
committed
Revert Roads.java
1 parent 96bf806 commit e4a41b9

File tree

1 file changed

+56
-56
lines changed
  • tiles/src/main/java/com/protomaps/basemap/layers

1 file changed

+56
-56
lines changed

tiles/src/main/java/com/protomaps/basemap/layers/Roads.java

+56-56
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public List<OsmRelationInfo> preprocessOsmRelation(OsmElement.Relation relation)
5656
public void processOsm(SourceFeature sf, FeatureCollector features) {
5757
if (sf.canBeLine() && sf.hasTag("highway") &&
5858
!(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;
6363
int minZoomShieldText = 10;
6464
int minZoomNames = 14;
6565

@@ -96,8 +96,8 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
9696
if (highway.equals("motorway") || highway.equals("motorway_link")) {
9797
// TODO: (nvkelso 20230622) Use Natural Earth for low zoom roads at zoom 5 and earlier
9898
// 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;
101101

102102
if (highway.equals("motorway")) {
103103
minZoomShieldText = 7;
@@ -109,11 +109,11 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
109109
} else if (highway.equals("trunk") || highway.equals("trunk_link") || highway.equals("primary") ||
110110
highway.equals("primary_link")) {
111111
kind = "major_road";
112-
minZoom = 7; //
112+
minZoom = 7;
113113

114114
if (highway.equals("trunk")) {
115115
// Just trunk earlier zoom, otherwise road network looks choppy just with motorways then
116-
minZoom = hasOverride ? 7 : 6; //
116+
minZoom = hasOverride ? 7 : 6;
117117
minZoomShieldText = 8;
118118
} else if (highway.equals("primary")) {
119119
minZoomShieldText = 10;
@@ -126,8 +126,8 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
126126
minZoomNames = 12;
127127
} else if (highway.equals("secondary") || highway.equals("secondary_link") || highway.equals("tertiary") ||
128128
highway.equals("tertiary_link")) {
129-
kind = "major_road"; //
130-
minZoom = 9; //
129+
kind = "major_road";
130+
minZoom = 9;
131131

132132
if (highway.equals("secondary")) {
133133
minZoomShieldText = 11;
@@ -141,53 +141,53 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
141141
}
142142
} else if (highway.equals("residential") || highway.equals("service") || highway.equals("unclassified") ||
143143
highway.equals("road") || highway.equals("raceway")) {
144-
kind = "minor_road"; //
145-
minZoom = 12; //
144+
kind = "minor_road";
145+
minZoom = 12;
146146
minZoomShieldText = 12;
147147
minZoomNames = 14;
148148

149149
if (highway.equals("service")) {
150-
kindDetail = "service"; //
151-
minZoom = 13; //
150+
kindDetail = "service";
151+
minZoom = 13;
152152

153153
// push down "alley", "driveway", "parking_aisle", "drive-through" & etc
154154
if (sf.hasTag("service")) {
155-
minZoom = 14; //
156-
service = sf.getString("service"); //
155+
minZoom = 14;
156+
service = sf.getString("service");
157157
}
158158
}
159159
} else if (sf.hasTag("highway", "pedestrian", "track", "path", "cycleway", "bridleway", "footway",
160160
"steps", "corridor")) {
161-
kind = "path"; //
162-
kindDetail = highway; //
163-
minZoom = 12; //
161+
kind = "path";
162+
kindDetail = highway;
163+
minZoom = 12;
164164
minZoomShieldText = 12;
165165
minZoomNames = 14;
166166

167167
if (sf.hasTag("highway", "path", "cycleway", "bridleway", "footway", "steps")) {
168-
minZoom = 13; //
168+
minZoom = 13;
169169
}
170170
if (sf.hasTag("footway", "sidewalk", "crossing")) {
171-
minZoom = 14; //
172-
kindDetail = sf.getString("footway", ""); //
171+
minZoom = 14;
172+
kindDetail = sf.getString("footway", "");
173173
}
174174
if (sf.hasTag("highway", "corridor")) {
175-
minZoom = 14; //
175+
minZoom = 14;
176176
}
177177
} else {
178-
kind = "other"; //
179-
kindDetail = sf.getString("service", ""); //
180-
minZoom = 14; //
178+
kind = "other";
179+
kindDetail = sf.getString("service", "");
180+
minZoom = 14;
181181
minZoomShieldText = 14;
182182
minZoomNames = 14;
183183
}
184184

185185
if (hasOverride) {
186186
if (BRoad) {
187-
minZoom = 6; //
187+
minZoom = 6;
188188
}
189189
if (ARoad) {
190-
minZoom = 3; //
190+
minZoom = 3;
191191
}
192192
}
193193

@@ -208,9 +208,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
208208
.setZoomRange(minZoom, maxZoom);
209209

210210
if (!kindDetail.isEmpty()) {
211-
feat.setAttr("kind_detail", kindDetail); //
211+
feat.setAttr("kind_detail", kindDetail);
212212
} else {
213-
feat.setAttr("kind_detail", highway); //
213+
feat.setAttr("kind_detail", highway);
214214
}
215215

216216
// Core OSM tags for different kinds of places
@@ -239,60 +239,60 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
239239

240240
// non-highway features
241241
// 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"))) {
249249

250250
int minZoom = 11;
251251

252252
if (sf.hasTag("aeroway", "runway")) {
253-
minZoom = 9; //
253+
minZoom = 9;
254254
} else if (sf.hasTag("aeroway", "taxiway")) {
255-
minZoom = 10; //
255+
minZoom = 10;
256256
} else if (sf.hasTag("service", "yard", "siding", "crossover")) {
257-
minZoom = 13; //
257+
minZoom = 13;
258258
} else if (sf.hasTag("man_made", "pier")) {
259-
minZoom = 13; //
259+
minZoom = 13;
260260
}
261261

262262
String kind = "other";
263263
String kindDetail = "";
264264
if (sf.hasTag("aeroway")) {
265-
kind = "aeroway"; //
266-
kindDetail = sf.getString("aeroway"); //
265+
kind = "aeroway";
266+
kindDetail = sf.getString("aeroway");
267267
} else if (sf.hasTag("railway", "disused", "funicular", "light_rail", "miniature", "monorail", "narrow_gauge",
268268
"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;
272272

273273
if (sf.hasTag("railway", "disused")) {
274-
minZoom = 15; //
274+
minZoom = 15;
275275
}
276276
} else if (sf.hasTag("railway")) {
277-
kind = "rail"; //
278-
kindDetail = sf.getString("railway"); //
277+
kind = "rail";
278+
kindDetail = sf.getString("railway");
279279

280280
if (kindDetail.equals("service")) {
281-
minZoom = 13; //
281+
minZoom = 13;
282282

283283
// eg a rail yard
284284
if (sf.hasTag("service")) {
285-
minZoom = 14; //
285+
minZoom = 14;
286286
}
287287
}
288288
} else if (sf.hasTag("route", "ferry")) {
289-
kind = "ferry"; //
289+
kind = "ferry";
290290
} else if (sf.hasTag("man_made", "pier")) {
291-
kind = "path"; //
292-
kindDetail = "pier"; //
291+
kind = "path";
292+
kindDetail = "pier";
293293
} else if (sf.hasTag("aerialway")) {
294-
kind = "aerialway"; //
295-
kindDetail = sf.getString("aerialway"); //
294+
kind = "aerialway";
295+
kindDetail = sf.getString("aerialway");
296296
}
297297

298298
var feature = features.line(this.name())

0 commit comments

Comments
 (0)