Ignore highways with non-routing tags

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head v1.1.1
Taylor Smock 2020-01-13 13:25:01 -07:00
rodzic 49f6ff7527
commit 39b66da4e2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -50,6 +50,7 @@ public class RoutingIslandsTest extends Test {
private static final String HIGHWAY = "highway";
private static final String WATERWAY = "waterway";
private static final List<String> IGNORE_TAGS = Arrays.asList("services", "rest_area");
/**
* This is mostly as a sanity check, and to avoid infinite recursion (shouldn't
@ -91,8 +92,9 @@ public class RoutingIslandsTest extends Test {
@Override
public void visit(Way way) {
if (way.isUsable() && way.getNodes().parallelStream().anyMatch(node -> way.getDataSet().getDataSourceBounds()
.parallelStream().anyMatch(source -> source.contains(node.getCoor())))) {
if (way.isUsable() && !IGNORE_TAGS.contains(way.get("highway")) && !IGNORE_TAGS.contains(way.get("waterway"))
&& way.getNodes().parallelStream().anyMatch(node -> way.getDataSet().getDataSourceBounds()
.parallelStream().anyMatch(source -> source.contains(node.getCoor())))) {
if ((way.hasKey(HIGHWAY) || way.hasKey(WATERWAY))
&& way.getNodes().parallelStream().flatMap(node -> node.getReferrers().parallelStream()).distinct()
.allMatch(way::equals)