How to customize walking speed
By default the Routing API assumes a conservative walking speed of 1 m/s. You can see this by checking the summary information in the response.
For example take a look at this 15 km long route:
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.547019,13.328605&'\
'destination=52.541812,13.334422&'\
'return=summary,polyline&'\
'spans=dynamicSpeedInfo&'\
'transportMode=pedestrian&'\
'apiKey=YOUR_API_KEY'In the response, you can see that the baseSpeed is 1 m/s. The duration (in seconds) is also identical to the length (in meters) due to the route not containing any turnTime:
"sections": [
{
...,
"summary": {
"duration": 770,
"length": 770,
"baseDuration": 770
},
"polyline": "...",
"spans": [
{
"offset": 0,
"dynamicSpeedInfo": {
"trafficSpeed": 1,
"baseSpeed": 1,
"turnTime": 0
}
}
],
"transport": {
"mode": "pedestrian"
}
}
]Set user-defined walking speed
As not everyone walks at the same pace, you can set the walking speed in the request, by means of the pedestrian[speed] parameter.
The following request sets it a less pessimistic walking speed of 1.42 m/s:
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.547019,13.328605&'\
'destination=52.541812,13.334422&'\
'return=summary,polyline&'\
'spans=dynamicSpeedInfo&'\
'transportMode=pedestrian&'\
'pedestrian[speed]=1.42&'\
'apiKey=YOUR_API_KEY'As you can see, the value of duration is much lower: only 544 s for 770 m. The baseSpeed is increased to 1.42 m/s:
"sections": [
{
"summary": {
"duration": 544,
"length": 770,
"baseDuration": 544
},
"polyline": "...",
"spans": [
{
"offset": 0,
"dynamicSpeedInfo": {
"trafficSpeed": 1.42,
"baseSpeed": 1.42,
"turnTime": 0
}
}
],
...
}
]Updated last month