Car with Clusters on Topology Segments
User Story
The user is looking for the fastest way through a number of destinations located in a residential area. The waypoints located on a road between two junctions shall be kept together.
Request
curl -H "Authorization: Bearer TOKEN_HERE" "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"
curl "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&apikey=APIKEY_HERE"
Response
The service puts the waypoints at a topology segment together in the sequence. This is reflected by the attribute cluster
in the waypoints section of the response. Please observe that the waypoint with the id "E" belongs to no cluster. It is the only destination on its topology segment. The interconnection section is shortened in the example response.
{
"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": "A",
"lat": 50.11778,
"lng": 8.630247,
"sequence": 3,
"estimatedArrival": null,
"estimatedDeparture": null,
"fulfilledConstraints": [],
"cluster": 1
},
{
"id": "D",
"lat": 50.117922,
"lng": 8.630277,
"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": "2022-06-01T07:35:24+02:00",
"estimatedDeparture": null,
"fulfilledConstraints": []
}
],
"distance": "1876",
"time": "324",
"interconnections": [
{
"fromWaypoint": "Start",
"toWaypoint": "C",
"distance": 536.0,
"time": 115.0,
"rest": 0.0,
"waiting": 0.0
},
...
],
"description": "Targeted best time; without traffic",
"timeBreakdown":
{
"driving": 324,
"service": 0,
"rest": 0,
"waiting": 0
}
}
],
"processingTimeDesc": "365ms",
"responseCode": "200",
"warnings": null,
"requestId": null
}