Waypoints sequence optimized with time constraints
User story
The car journey starts in Duisburg Ruhrort and the destination is the nearby Duisburg-Haefen, but the route must visit Zeche Zollverein, Kokerei Zollverein and Muehlheim. The driver needs the fastest possible route.
Request
Consider the following request example
curl -H "Authorization: Bearer TOKEN_HERE" "https://wps.hereapi.com/v8/findsequence2?departure=2015-05-04T8:00:00%2b01:00&mode=fastest;car;traffic:disabled&start=DuisburgRuhrort;51.4541,6.7406&destination1=ZecheZollverein;51.486,7.0459;acc:mo09:00:00%2b01:00%7cmo10:00:00%2b01:00;st:60&destination2=KokereiZollverein;51.4879,7.0337;acc:mo10:30:00%2b01:00%7cmo12:00:00%2b01:00;st:600&destination3=MuehlheimRuhrHbf;51.432,6.886;acc:mo08:00:00%2b01:00%7cmo09:00:00%2b01:00;st:60&end=DuisburgHafen;51.4576,6.7717&improveFor=TIME"
curl "https://wps.hereapi.com/v8/findsequence2?departure=2015-05-04T8:00:00%2b01:00&mode=fastest;car;traffic:disabled&start=DuisburgRuhrort;51.4541,6.7406&destination1=ZecheZollverein;51.486,7.0459;acc:mo09:00:00%2b01:00%7cmo10:00:00%2b01:00;st:60&destination2=KokereiZollverein;51.4879,7.0337;acc:mo10:30:00%2b01:00%7cmo12:00:00%2b01:00;st:600&destination3=MuehlheimRuhrHbf;51.432,6.886;acc:mo08:00:00%2b01:00%7cmo09:00:00%2b01:00;st:60&end=DuisburgHafen;51.4576,6.7717&improveFor=TIME&apikey=APIKEY_HERE"
where the constraints are:
-
acc
- access hours when a destination can be visited (requires a service time setting) -
st
- service time spent at the waypoint in seconds
For more information, see API reference.
Response
{
"results" : [{
"waypoints" : [{
"id" : "DuisburgRuhrort",
"lat" : 51.4541,
"lng" : 6.7406,
"sequence" : 0,
"estimatedArrival" : null,
"estimatedDeparture" : "2015-05-04T08:00:00+01:00",
"fulfilledConstraints" : []
}, {
"id" : "MuehlheimRuhrHbf",
"lat" : 51.432,
"lng" : 6.886,
"sequence" : 1,
"estimatedArrival" : "2015-05-04T08:14:45+01:00",
"estimatedDeparture" : "2015-05-04T08:15:45+01:00",
"fulfilledConstraints" : [
"acc:mo08:00:00+01:00|mo09:00:00+01:00;st:60"
]
}, {
"id" : "ZecheZollverein",
"lat" : 51.486,
"lng" : 7.0459,
"sequence" : 2,
"estimatedArrival" : "2015-05-04T08:37:03+01:00",
"estimatedDeparture" : "2015-05-04T09:01:00+01:00",
"fulfilledConstraints" : [
"acc:mo09:00:00+01:00|mo10:00:00+01:00;st:60"
]
}, {
"id" : "KokereiZollverein",
"lat" : 51.4879,
"lng" : 7.0337,
"sequence" : 3,
"estimatedArrival" : "2015-05-04T09:04:33+01:00",
"estimatedDeparture" : "2015-05-04T10:40:00+01:00",
"fulfilledConstraints" : [
"acc:mo10:30:00+01:00|mo12:00:00+01:00;st:600"
]
}, {
"id" : "DuisburgHafen",
"lat" : 51.4576,
"lng" : 6.7717,
"sequence" : 4,
"estimatedArrival" : "2015-05-04T11:03:51+01:00",
"estimatedDeparture" : null,
"fulfilledConstraints" : []
}
],
"distance" : "60054",
"time" : "11031",
"interconnections" : [{
"fromWaypoint" : "DuisburgRuhrort",
"toWaypoint" : "MuehlheimRuhrHbf",
"distance" : 14002.0,
"time" : 885.0
}, {
"fromWaypoint" : "MuehlheimRuhrHbf",
"toWaypoint" : "ZecheZollverein",
"distance" : 17797.0,
"time" : 1278.0
}, {
"fromWaypoint" : "ZecheZollverein",
"toWaypoint" : "KokereiZollverein",
"distance" : 1488.0,
"time" : 213.0
}, {
"fromWaypoint" : "KokereiZollverein",
"toWaypoint" : "DuisburgHafen",
"distance" : 26767.0,
"time" : 1431.0
}
],
"description" : "Targeted best time; without traffic"
}
],
"processingTimeDesc" : "993ms",
"responseCode" : "200",
"warnings" : null,
"requestId" : null
}