Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ice roads from Finland routing #5355

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ else if (speedLimit <= 16.65f) {
props.setProperties("highway=service;access=private", withModes(NONE));
props.setProperties("highway=trail", withModes(NONE));

// Remove ice/winter roads
props.setProperties("highway=*;seasonal=winter", withModes(NONE));
props.setProperties("highway=*;ice_road=yes", withModes(NONE));
props.setProperties("highway=*;winter_road=yes", withModes(NONE));

// No biking on designated footways/sidewalks
props.setProperties("highway=footway", withModes(PEDESTRIAN));
props.setProperties("footway=sidewalk;highway=footway", withModes(PEDESTRIAN));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.opentripplanner.openstreetmap.tagmapping;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.opentripplanner.street.model.StreetTraversalPermission.NONE;

import org.junit.jupiter.api.Test;
import org.opentripplanner.openstreetmap.model.OSMWay;
import org.opentripplanner.openstreetmap.model.OSMWithTags;
import org.opentripplanner.openstreetmap.wayproperty.WayProperties;
import org.opentripplanner.openstreetmap.wayproperty.WayPropertySet;

public class FinlandMapperTest {
Expand Down Expand Up @@ -190,4 +193,28 @@ public void testSafetyWithMixins() {
epsilon
);
}

@Test
public void testTagMapping() {
OSMWithTags way;
WayProperties wayData;

way = new OSMWay();
way.addTag("highway", "unclassified");
way.addTag("seasonal", "winter");
wayData = wps.getDataForWay(way);
assertEquals(wayData.getPermission(), NONE);

way = new OSMWay();
way.addTag("highway", "trunk");
way.addTag("ice_road", "yes");
wayData = wps.getDataForWay(way);
assertEquals(wayData.getPermission(), NONE);

way = new OSMWay();
way.addTag("highway", "track");
way.addTag("winter_road", "yes");
wayData = wps.getDataForWay(way);
assertEquals(wayData.getPermission(), NONE);
}
}