宛先のクラスタで時間を節約する方法
ユーザーは、住宅地にある多数の目的地を最速で通過する方法を探しています。2つの交差点間の道路に複数の経由地がある場合はまとめられます。
リクエスト
curl -H "Authorization: Bearer BEARER_TOKEN" "https://wps.hereapi.com/v8/findsequence2?mode=fastest;car;traffic:disabled;&start=Start;50.116300,8.628638&end=End;50.116300,8.628638&destination1=A;50.117780,8.630247&destination2=B;50.118227,8.630328&destination3=C;50.118357,8.630335&destination4=D;50.117922,8.630277&destination5=E;50.117841,8.631541&destination6=F;50.117783,8.632024&destination7=G;50.117766,8.632335&clustering=topologySegment"レスポンス
このサービスは、シーケンスで1つのトポロジーセグメントにある複数の経由地をまとめます。これは、レスポンスの経由地セクションの属性clusterによって反映されます。識別子"E"の経由地がどのクラスターにも属していないことに注目してください。これはトポロジーセグメントの唯一の目的地です。レスポンス例では、相互接続セクションが短縮されています。
{
"results": [
{
"waypoints": [
{
"id": "Start",
"lat": 50.1163,
"lng": 8.628638,
"sequence": 0,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": []
},
{
"id": "C",
"lat": 50.118357,
"lng": 8.630335,
"sequence": 1,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 0
},
{
"id": "B",
"lat": 50.118227,
"lng": 8.630328,
"sequence": 2,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 0
},
{
"id": "D",
"lat": 50.117922,
"lng": 8.630277,
"sequence": 3,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 1
},
{
"id": "A",
"lat": 50.11778,
"lng": 8.630247,
"sequence": 4,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 1
},
{
"id": "E",
"lat": 50.117841,
"lng": 8.631541,
"sequence": 5,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": []
},
{
"id": "F",
"lat": 50.117783,
"lng": 8.632024,
"sequence": 6,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 2
},
{
"id": "G",
"lat": 50.117766,
"lng": 8.632335,
"sequence": 7,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 2
},
{
"id": "End",
"lat": 50.1163,
"lng": 8.628638,
"sequence": 8,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": []
}
],
"distance": "1840",
"time": "279",
"interconnections": [
{
"fromWaypoint": "Start",
"toWaypoint": "C",
"distance": 537,
"time": 97,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "C",
"toWaypoint": "B",
"distance": 14,
"time": 2,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "B",
"toWaypoint": "D",
"distance": 32,
"time": 4,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "D",
"toWaypoint": "A",
"distance": 16,
"time": 3,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "A",
"toWaypoint": "E",
"distance": 77,
"time": 11,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "E",
"toWaypoint": "F",
"distance": 35,
"time": 5,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "F",
"toWaypoint": "G",
"distance": 22,
"time": 4,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "G",
"toWaypoint": "End",
"distance": 1107,
"time": 153,
"rest": 0,
"waiting": 0
}
],
"description": "Targeted best time; without traffic",
"timeBreakdown": {
"driving": 279,
"service": 0,
"rest": 0,
"waiting": 0,
"break": 0
}
}
],
"errors": [],
"processingTimeDesc": "112ms",
"responseCode": "200",
"warnings": null,
"requestId": "173fa809-0224-490e-b84d-475e2070b633"
}19 日前の更新