Skip to content

Commit 96bf806

Browse files
committed
Format
1 parent 70ba4a7 commit 96bf806

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
244244
sf.hasTag("man_made", "pier") || //
245245
sf.hasTag("route", "ferry") || //
246246
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"))) {
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

@@ -254,7 +254,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
254254
} else if (sf.hasTag("aeroway", "taxiway")) {
255255
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")) {
259259
minZoom = 13; //
260260
}

tiles/src/test/java/com/protomaps/basemap/layers/RoadsTest.java

+51-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import java.util.Map;
1212
import org.junit.jupiter.api.Test;
1313
import org.junit.jupiter.params.ParameterizedTest;
14-
import org.junit.jupiter.params.provider.ValueSource;
1514
import org.junit.jupiter.params.provider.CsvSource;
1615

1716

@@ -331,7 +330,7 @@ void testRailway() {
331330
"monorail",
332331
"narrow_gauge",
333332
"preserved",
334-
"subway",
333+
"subway",
335334
"tram"
336335
})
337336
void testRailwaysSpecial(String railway) {
@@ -429,4 +428,54 @@ void testAerowayRunway() {
429428
)
430429
);
431430
}
431+
432+
@Test
433+
void testAvoidBuildings() {
434+
assertFeatures(12,
435+
List.of(),
436+
processWithRelationAndCoords("",
437+
0, 0, 1, 1,
438+
"aeroway", "runway",
439+
"building", "a"
440+
)
441+
);
442+
}
443+
444+
@ParameterizedTest
445+
@CsvSource({
446+
"abandoned",
447+
"razed",
448+
"demolished",
449+
"removed",
450+
"construction",
451+
"platform",
452+
"proposed"
453+
})
454+
void testRailwayExcluded(String railway) {
455+
assertFeatures(12,
456+
List.of(),
457+
processWithRelationAndCoords("",
458+
0, 0, 1, 1,
459+
"railway", railway
460+
)
461+
);
462+
}
463+
464+
@ParameterizedTest
465+
@CsvSource({
466+
"yard",
467+
"siding",
468+
"crossover"
469+
})
470+
void testRailwayService(String service) {
471+
assertFeatures(13,
472+
List.of(Map.of("_minzoom", 13)),
473+
processWithRelationAndCoords("",
474+
0, 0, 1, 1,
475+
"railway", "a",
476+
"service", service
477+
)
478+
);
479+
}
480+
432481
}

0 commit comments

Comments
 (0)