From 9535875d690d4630575e7648f9b915cddbd03e16 Mon Sep 17 00:00:00 2001 From: aoles Date: Thu, 30 Sep 2021 15:53:13 +0200 Subject: [PATCH] Change implied road surface type from "asphalt" to "paved" --- CHANGELOG.md | 1 + .../java/org/heigit/ors/services/routing/ResultTest.java | 4 ++-- .../org/heigit/ors/v2/services/routing/ResultTest.java | 8 ++++---- .../builders/WaySurfaceTypeGraphStorageBuilder.java | 4 +--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71e54ded56..97e7ec48e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ RELEASING: - test config format and filetype to JSON - docker `APP_CONFIG` argument to `ORS_CONFIG` ([#1017](https://github.com/GIScience/openrouteservice/issues/1017)) - default minimum `surface-type` for wheelchair to `sett` ([#1059](https://github.com/GIScience/openrouteservice/issues/1059)) +- Default road surface value is now "paved" rather than "asphalt" ([#711](https://github.com/GIScience/openrouteservice/issues/711)) ### Deprecated - `ors_app_config` system property ([#1017](https://github.com/GIScience/openrouteservice/issues/1017)) - `app.config` ors configuration file name ([#1017](https://github.com/GIScience/openrouteservice/issues/1017)) diff --git a/openrouteservice-api-tests/src/test/java/org/heigit/ors/services/routing/ResultTest.java b/openrouteservice-api-tests/src/test/java/org/heigit/ors/services/routing/ResultTest.java index 61a99709ce..8b006c7577 100644 --- a/openrouteservice-api-tests/src/test/java/org/heigit/ors/services/routing/ResultTest.java +++ b/openrouteservice-api-tests/src/test/java/org/heigit/ors/services/routing/ResultTest.java @@ -765,8 +765,8 @@ public void testExtrasDetails() { .assertThat() .body("any { it.key == 'routes' }", is(true)) .body("routes[0].containsKey('extras')", is(true)) - .body("routes[0].extras.surface.values.size()", is(28)) - .body("routes[0].extras.surface.values[18][1]", is(342)) + .body("routes[0].extras.surface.values.size()", is(38)) + .body("routes[0].extras.surface.values[18][1]", is(258)) .body("routes[0].extras.suitability.values[18][0]", is(521)) .body("routes[0].extras.steepness.values[10][1]", is(326)) diff --git a/openrouteservice-api-tests/src/test/java/org/heigit/ors/v2/services/routing/ResultTest.java b/openrouteservice-api-tests/src/test/java/org/heigit/ors/v2/services/routing/ResultTest.java index 007d7606a2..b962210795 100644 --- a/openrouteservice-api-tests/src/test/java/org/heigit/ors/v2/services/routing/ResultTest.java +++ b/openrouteservice-api-tests/src/test/java/org/heigit/ors/v2/services/routing/ResultTest.java @@ -971,8 +971,8 @@ public void testExtrasDetails() { .assertThat() .body("any { it.key == 'routes' }", is(true)) .body("routes[0].containsKey('extras')", is(true)) - .body("routes[0].extras.surface.values.size()", is(28)) - .body("routes[0].extras.surface.values[18][1]", is(342)) + .body("routes[0].extras.surface.values.size()", is(38)) + .body("routes[0].extras.surface.values[18][1]", is(258)) .body("routes[0].extras.suitability.values[18][0]", is(521)) .body("routes[0].extras.steepness.values[10][1]", is(326)) .statusCode(200); @@ -3132,9 +3132,9 @@ public void testAlternativeRoutes() { .body("routes[1].summary.distance", is( 6435.1f)) .body("routes[1].summary.duration", is(801.5f)) .body("routes[0].way_points[-1]", is(223)) - .body("routes[0].extras.surface.values[0][1]", is(223)) + .body("routes[0].extras.surface.values[0][1]", is(3)) .body("routes[1].way_points[-1]", is(202)) - .body("routes[1].extras.surface.values[6][1]", is(202)) + .body("routes[1].extras.surface.values[4][1]", is(202)) .statusCode(200); JSONObject avoidGeom = new JSONObject("{\"type\":\"Polygon\",\"coordinates\":[[[8.685873,49.414421], [8.688169,49.403978], [8.702095,49.407762], [8.695185,49.416013], [8.685873,49.414421]]]}}"); diff --git a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/WaySurfaceTypeGraphStorageBuilder.java b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/WaySurfaceTypeGraphStorageBuilder.java index 48b0033da3..360b3e8024 100644 --- a/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/WaySurfaceTypeGraphStorageBuilder.java +++ b/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/storages/builders/WaySurfaceTypeGraphStorageBuilder.java @@ -23,8 +23,6 @@ import org.heigit.ors.routing.util.WaySurfaceDescription; import java.util.HashSet; -import java.util.Iterator; -import java.util.Map.Entry; public class WaySurfaceTypeGraphStorageBuilder extends AbstractGraphStorageBuilder { public static final String TAG_HIGHWAY = "highway"; @@ -64,7 +62,7 @@ public void processWay(ReaderWay way) { int surfaceType = way.hasTag(TAG_SURFACE) ? SurfaceType.getFromString(way.getTag(TAG_SURFACE)) : SurfaceType.UNKNOWN; if (surfaceType == SurfaceType.UNKNOWN) { if (wayType == WayType.ROAD || wayType == WayType.STATE_ROAD || wayType == WayType.STREET) { - surfaceType = SurfaceType.ASPHALT; + surfaceType = SurfaceType.PAVED; } else if (wayType == WayType.PATH) { surfaceType = SurfaceType.UNPAVED; }