forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opentripplanner#6254 from HSLdevcom/stricter-motor…
…-vehicle-nothrough Apply stricter motor vehicle nothrough traffic rules in Finland
- Loading branch information
Showing
6 changed files
with
87 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
application/src/test/java/org/opentripplanner/osm/tagmapping/ConstantSpeedMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.opentripplanner.osm.tagmapping; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.opentripplanner.osm.model.OsmWithTags; | ||
|
||
public class ConstantSpeedMapperTest { | ||
|
||
@Test | ||
public void constantSpeedCarRouting() { | ||
OsmTagMapper osmTagMapper = new ConstantSpeedFinlandMapper(20f); | ||
|
||
var slowWay = new OsmWithTags(); | ||
slowWay.addTag("highway", "residential"); | ||
assertEquals(20f, osmTagMapper.getCarSpeedForWay(slowWay, true)); | ||
|
||
var fastWay = new OsmWithTags(); | ||
fastWay.addTag("highway", "motorway"); | ||
fastWay.addTag("maxspeed", "120 kmph"); | ||
assertEquals(20f, osmTagMapper.getCarSpeedForWay(fastWay, true)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters