フェリーを使用するルートの所要時間を計算する
これは、フェリーを経由するルートの交通情報を含まない所要時間の計算リクエストです。
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=51.13747,1.33148&'\
'destination=50.96035,1.905025&'\
'return=summary&'\
'transportMode=car&'\
'apiKey=YOUR_API_KEY'{
"routes": [
{
"id": "fe1d3ac8-411e-4b47-bd2a-8056484865ce",
"sections": [
{
"id": "3f104c2d-7ec2-4a63-9e3b-dcf6b9acd251",
"type": "vehicle",
...,
"summary": {
"duration": 541,
"length": 3898,
"baseDuration": 501
},
"transport": {
"mode": "car"
}
},
{
"id": "2239e39b-4eef-4ce0-9988-1c434a1e13a9",
"type": "transit",
"preActions": [
{
"action": "board",
"duration": 1200
}
],
"postActions": [
{
"action": "deboard",
"duration": 600
}
],
...,
"summary": {
"duration": 5449,
"length": 40565
},
"notices": [
{
"title": "No schedule information available.",
"code": "noSchedule",
"severity": "info"
}
],
"transport": {
"mode": "ferry",
"name": "Dover-Calais"
}
},
{
"id": "554714bc-a8c1-406f-8895-d2f81f88722e",
"type": "vehicle",
...,
"summary": {
"duration": 440,
"length": 5273,
"baseDuration": 396
},
"transport": {
"mode": "car"
}
}
]
}
]
}計算
このリクエストの計算の詳細は次のとおりです。
Duration without traffic =
first section `baseDuration`
+ second (ferry) section `duration`
+ third section `baseDuration`
= 501s + 5449s + 396s
= 6346s
= 1h45m46s
フェリーの詳細については、「特定のフェリーを使用する」を参照してください。
先月の更新