Skip to content

Commit

Permalink
Draft PR for issue graphhopper#3070
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Oct 27, 2024
1 parent 49139dd commit 8edfe07
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final DecimalEncodedValue getAverageSpeedEnc() {

protected void setSpeed(boolean reverse, int edgeId, EdgeIntAccess edgeIntAccess, double speed) {
if (speed < avgSpeedEnc.getSmallestNonZeroValue() / 2) {
throw new IllegalArgumentException("Speed was " + speed + " but cannot be lower than " + avgSpeedEnc.getSmallestNonZeroValue() / 2);
avgSpeedEnc.setDecimal(reverse, edgeId, edgeIntAccess, avgSpeedEnc.getSmallestNonZeroValue());
} else {
avgSpeedEnc.setDecimal(reverse, edgeId, edgeIntAccess, speed);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ public void testSmoothness() {

way.setTag("smoothness", "impassable");
assertEquals(MIN_SPEED, getSpeedFromFlags(way), 0.01);

way.setTag("maxspeed", "0.5");
assertEquals(MIN_SPEED, getSpeedFromFlags(way), 0.01);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void testSetSpeed() {
avSpeedEnc.setDecimal(false, edgeId, edgeIntAccess, 10);
assertEquals(10, avSpeedEnc.getDecimal(false, edgeId, edgeIntAccess), 1e-1);
}

/*
@Test
public void testSetSpeed0_issue367_issue1234() {
EdgeIntAccess edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
Expand All @@ -418,7 +418,7 @@ public void testSetSpeed0_issue367_issue1234() {
assertTrue(accessEnc.getBool(true, edgeId, edgeIntAccess));
}

*/
@Test
public void testRoundabout() {
EdgeIntAccess edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
Expand Down

0 comments on commit 8edfe07

Please sign in to comment.