@@ -730,4 +730,35 @@ void footway_etc_not_allowed_despite_vehicle_yes(String vehicle) {
730
730
assertEquals (WayAccess .CAN_SKIP , parser .getAccess (way ));
731
731
}
732
732
}
733
+
734
+ @ Test
735
+ void nonHighwaysFallbackSpeed_issue2845 () {
736
+ ReaderWay way = new ReaderWay (1 );
737
+ way .setTag ("man_made" , "pier" );
738
+ EdgeIntAccess edgeIntAccess = new ArrayEdgeIntAccess (em .getIntsForFlags ());
739
+ speedParser .handleWayTags (0 , edgeIntAccess , way );
740
+ assertEquals (10 , avSpeedEnc .getDecimal (false , 0 , edgeIntAccess ), 1e-1 );
741
+
742
+ way .clearTags ();
743
+ way .setTag ("railway" , "platform" );
744
+ speedParser .handleWayTags (0 , edgeIntAccess = new ArrayEdgeIntAccess (em .getIntsForFlags ()), way );
745
+ assertEquals (10 , avSpeedEnc .getDecimal (false , 0 , edgeIntAccess ), 1e-1 );
746
+
747
+ way .clearTags ();
748
+ way .setTag ("route" , "ski" );
749
+ speedParser .handleWayTags (0 , edgeIntAccess = new ArrayEdgeIntAccess (em .getIntsForFlags ()), way );
750
+ assertEquals (10 , avSpeedEnc .getDecimal (false , 0 , edgeIntAccess ), 1e-1 );
751
+
752
+ way .clearTags ();
753
+ way .setTag ("highway" , "abandoned" );
754
+ speedParser .handleWayTags (0 , edgeIntAccess = new ArrayEdgeIntAccess (em .getIntsForFlags ()), way );
755
+ assertEquals (10 , avSpeedEnc .getDecimal (false , 0 , edgeIntAccess ), 1e-1 );
756
+
757
+ way .clearTags ();
758
+ way .setTag ("highway" , "construction" );
759
+ way .setTag ("maxspeed" , "100" );
760
+ speedParser .handleWayTags (0 , edgeIntAccess = new ArrayEdgeIntAccess (em .getIntsForFlags ()), way );
761
+ // unknown highways can be quite fast in combination with maxspeed!?
762
+ assertEquals (90 , avSpeedEnc .getDecimal (false , 0 , edgeIntAccess ), 1e-1 );
763
+ }
733
764
}
0 commit comments