A side_road tag support for the OSRM car profile.
This commit is contained in:
		
							parent
							
								
									5a9bee0527
								
							
						
					
					
						commit
						4d4a3d02ed
					
				| @ -131,6 +131,8 @@ maxspeed_table = { | ||||
| traffic_signal_penalty          = 2 | ||||
| use_turn_restrictions           = true | ||||
| 
 | ||||
| side_road_speed_multiplier      = 0.8 | ||||
| 
 | ||||
| local turn_penalty              = 10 | ||||
| -- Note: this biases right-side driving.  Should be | ||||
| -- inverted for left-driving countries. | ||||
| @ -310,6 +312,14 @@ function way_function (way, result) | ||||
|     return | ||||
|   end | ||||
| 
 | ||||
|   -- reduce speed on special side roads | ||||
|   local sideway = way:get_value_by_key("side_road") | ||||
|   if "yes" == sideway or | ||||
|   "rotary" == sideway then | ||||
|     result.forward_speed = result.forward_speed * side_road_speed_multiplier | ||||
|     result.backward_speed = result.backward_speed * side_road_speed_multiplier | ||||
|   end | ||||
| 
 | ||||
|   -- reduce speed on bad surfaces | ||||
|   local surface = way:get_value_by_key("surface") | ||||
|   local tracktype = way:get_value_by_key("tracktype") | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user