@@ -55,8 +55,8 @@ public class InstructionListTest {
55
55
@ BeforeEach
56
56
public void setUp () {
57
57
speedEnc = new DecimalEncodedValueImpl ("speed" , 5 , 5 , true );
58
- carManager = EncodingManager .start ().add (speedEnc ).add (Roundabout .create ())
59
- . add (MaxSpeed .create ()).add (RoadClass .create ()).add (RoadClassLink .create ()).build ();
58
+ carManager = EncodingManager .start ().add (speedEnc ).add (Roundabout .create ()). add ( VehicleAccess . create ( "car" )).
59
+ add (MaxSpeed .create ()).add (RoadClass .create ()).add (RoadClassLink .create ()).build ();
60
60
}
61
61
62
62
private static List <String > getTurnDescriptions (InstructionList instructionList ) {
@@ -299,8 +299,9 @@ public void testNoInstructionIfSlightTurnAndAlternativeIsSharp2() {
299
299
@ Test
300
300
public void testNoInstructionIfSlightTurnAndAlternativeIsSharp3 () {
301
301
DecimalEncodedValue speedEnc = new DecimalEncodedValueImpl ("speed" , 4 , 2 , true );
302
- EncodingManager tmpEM = new EncodingManager .Builder ().add (speedEnc ).add (RoadClass .create ())
303
- .add (RoadClassLink .create ()).add (Roundabout .create ()).add (MaxSpeed .create ()).build ();
302
+ EncodingManager tmpEM = new EncodingManager .Builder ().add (speedEnc ).add (RoadClass .create ()).
303
+ add (VehicleAccess .create ("car" )).add (RoadClassLink .create ()).add (Roundabout .create ()).
304
+ add (MaxSpeed .create ()).build ();
304
305
EnumEncodedValue <RoadClass > rcEV = tmpEM .getEnumEncodedValue (RoadClass .KEY , RoadClass .class );
305
306
BaseGraph g = new BaseGraph .Builder (tmpEM ).create ();
306
307
// real world example: https://graphhopper.com/maps/?point=48.411549,15.599567&point=48.411663%2C15.600527&profile=bike
@@ -338,7 +339,9 @@ public void testNoInstructionIfSlightTurnAndAlternativeIsSharp3() {
338
339
@ Test
339
340
public void testInstructionIfTurn () {
340
341
DecimalEncodedValue speedEnc = new DecimalEncodedValueImpl ("speed" , 4 , 2 , true );
341
- EncodingManager tmpEM = new EncodingManager .Builder ().add (speedEnc ).add (RoadClass .create ()).add (RoadClassLink .create ()).add (Roundabout .create ()).add (MaxSpeed .create ()).build ();
342
+ EncodingManager tmpEM = new EncodingManager .Builder ().add (speedEnc ).add (RoadClass .create ()).
343
+ add (VehicleAccess .create ("car" )).add (RoadClassLink .create ()).add (Roundabout .create ()).
344
+ add (MaxSpeed .create ()).build ();
342
345
EnumEncodedValue <RoadClass > rcEV = tmpEM .getEnumEncodedValue (RoadClass .KEY , RoadClass .class );
343
346
BaseGraph g = new BaseGraph .Builder (tmpEM ).create ();
344
347
// real world example: https://graphhopper.com/maps/?point=48.412169%2C15.604888&point=48.412251%2C15.60543&profile=bike
@@ -375,8 +378,9 @@ public void testInstructionIfTurn() {
375
378
@ Test
376
379
public void testInstructionIfSlightTurn () {
377
380
DecimalEncodedValue speedEnc = new DecimalEncodedValueImpl ("speed" , 4 , 1 , false );
378
- EncodingManager tmpEM = new EncodingManager .Builder ().add (speedEnc )
379
- .add (Roundabout .create ()).add (RoadClass .create ()).add (RoadClassLink .create ()).add (MaxSpeed .create ()).build ();
381
+ EncodingManager tmpEM = new EncodingManager .Builder ().add (speedEnc ).add (Roundabout .create ()).
382
+ add (VehicleAccess .create ("car" )).add (RoadClass .create ()).add (RoadClassLink .create ()).
383
+ add (MaxSpeed .create ()).build ();
380
384
BaseGraph g = new BaseGraph .Builder (tmpEM ).create ();
381
385
// real world example: https://graphhopper.com/maps/?point=43.729379,7.417697&point=43.729798,7.417263&profile=foot
382
386
// From 4 to 3 and 4 to 1
@@ -428,8 +432,9 @@ public void testInstructionIfSlightTurn() {
428
432
public void testInstructionWithHighlyCustomProfileWithRoadsBase () {
429
433
BooleanEncodedValue roadsAccessEnc = new SimpleBooleanEncodedValue ("access" , true );
430
434
DecimalEncodedValue roadsSpeedEnc = new DecimalEncodedValueImpl ("speed" , 7 , 2 , true );
431
- EncodingManager tmpEM = EncodingManager .start ().add (roadsAccessEnc ).add (roadsSpeedEnc )
432
- .add (RoadClass .create ()).add (Roundabout .create ()).add (RoadClassLink .create ()).add (MaxSpeed .create ()).build ();
435
+ EncodingManager tmpEM = EncodingManager .start ().add (roadsAccessEnc ).add (roadsSpeedEnc ).
436
+ add (RoadClass .create ()).add (Roundabout .create ()).add (RoadClassLink .create ()).
437
+ add (MaxSpeed .create ()).add (VehicleAccess .create ("car" )).build ();
433
438
EnumEncodedValue <RoadClass > rcEV = tmpEM .getEnumEncodedValue (RoadClass .KEY , RoadClass .class );
434
439
BaseGraph g = new BaseGraph .Builder (tmpEM ).create ();
435
440
// real world example: https://graphhopper.com/maps/?point=55.691214%2C12.57065&point=55.689957%2C12.570387
@@ -523,7 +528,7 @@ public void testSplitWays() {
523
528
DecimalEncodedValue roadsSpeedEnc = new DecimalEncodedValueImpl ("speed" , 7 , 2 , true );
524
529
EncodingManager tmpEM = EncodingManager .start ().add (roadsSpeedEnc ).
525
530
add (RoadClass .create ()).add (Roundabout .create ()).add (RoadClassLink .create ()).
526
- add (MaxSpeed .create ()).add (Lanes .create ()).build ();
531
+ add (MaxSpeed .create ()).add (Lanes .create ()).add ( VehicleAccess . create ( "car" )). build ();
527
532
IntEncodedValue lanesEnc = tmpEM .getIntEncodedValue (Lanes .KEY );
528
533
BaseGraph g = new BaseGraph .Builder (tmpEM ).create ();
529
534
// real world example: https://graphhopper.com/maps/?point=43.626238%2C-79.715268&point=43.624647%2C-79.713204&profile=car
@@ -568,7 +573,7 @@ public void testSplitWays() {
568
573
@ Test
569
574
public void testNotSplitWays () {
570
575
DecimalEncodedValue roadsSpeedEnc = new DecimalEncodedValueImpl ("speed" , 7 , 2 , true );
571
- EncodingManager tmpEM = EncodingManager .start ().add (roadsSpeedEnc ).
576
+ EncodingManager tmpEM = EncodingManager .start ().add (roadsSpeedEnc ).add ( VehicleAccess . create ( "car" )).
572
577
add (RoadClass .create ()).add (Roundabout .create ()).add (RoadClassLink .create ()).
573
578
add (MaxSpeed .create ()).add (Lanes .create ()).build ();
574
579
IntEncodedValue lanesEnc = tmpEM .getIntEncodedValue (Lanes .KEY );
0 commit comments