我正在使用https://wse.api.here.com/2/findsequence.json
这是我的请求参数:
mode=fastest;car;traffic:disabled&departure=2019-10-10T15:39:28+03:00
这是尸体:
destination4=4;38.792417,-77.30097;acc:th00:00:00+03:00|fr00:00:00+03:00;st:180
&destination5=5;38.792344,-77.299805;before:destination4;acc:th00:00:00+03:00|th19:00:00+03:00;st:180&start=user;38.776573,-77.275411&destination7=7;38.804577,-77.279514;before:destination5;acc:th00:00:00+03:00|fr00:00:00+03:00;st:180
这就是我的回应:
{“ results”:[{“ waypoints”:[{“ id”:“ user”,“ lat”:38.776573,“ lng”:-77.275411,“ sequence”:0,“ estimatedArrival”:null,“ EstimatedDeparture“:” 2019-10-10T14:09:49 + 03:00“,” fulfilledConstraints“:[]},{” id“:” 5“,” lat“:38.792344,” lng“:-77.299805,”顺序“:1,” estimatedArrival“:” 2019-10-10T14:15:44 + 03:00“,” estimatedDeparture“:” 2019-10-10T14:18:44 + 03:00“,” fulfilledConstraints“:[ “ acc:th00:00:00 + 03:00 | fr19:00:00 + 03:00; st:180”,“之前:destination4”]},{“ id”:“ 4”,“ lat”:38.792417 ,“ lng”:-77.30097,“ sequence”:2,“ estimatedArrival”:“ 2019-10-10T14:19:21 + 03:00”,“ estimatedDeparture”:“ 2019-10-10T14:22:21 + 03 :00“,” fulfilledConstraints“:[” acc:th00:00:00 + 03:00 | fr00:00:00 + 03:00; st:180“]},{” id“:” 7“,” lat “:38.804577,” lng“:-77.279514,” sequence“:3,” estimatedArrival“:” 2019-10-10T14:28:19 + 03:00“,” estimatedDeparture“:null,” fulfilledConstraints“:[” acc :th00:00:00 + 03:00 | fr00:00:00 + 03:00; st:180“,”之前:destination5“]}],”距离“:” 7548“,”时间“:” 1290“ ,“互连”:[{“ fromWaypoint”:“用户”,“ toWaypoint”:“ 5”,“距离”:3626.0,“时间” :355.0,“休息”:0.0,“正在等待”:0.0},{“ fromWaypoint”:“ 5”,“ toWaypoint”:“ 4”,“距离”:191.0,“时间”:37.0,“休息”:0.0 ,“ waiting”:0.0},{“ fromWaypoint”:“ 4”,“ toWaypoint”:“ 7”,“距离”:3731.0,“ time”:358.0,“ rest”:0.0,“ waiting”:0.0}] ,“ description”:“目标最佳距离;没有 交通”,“ timeBreakdown”:{“驾驶”:750,“服务”:540,“休息”:0,“正在等待”:0}}],“错误”:[],“ processingTimeDesc”:“ 78ms”, “ responseCode”:“ 200”,“ warnings”:null,“ requestId”:null}
如您所见,我在 destination7 和 destination5 中具有 before
约束,但被忽略了。
我做错了吗?
答案 0 :(得分:1)
您具有以下航路点:start
,destination4
,destination5
和destination7
,约束:destination5
在destination4
和{{1}之前} destination7
之前。现在您没有指定destination5
航路点,因此该算法选择了一个航路点作为end
航路点以获得最佳结果(在这种情况下,选择end
作为最终航路点,这会覆盖约束)。请指定一个destination7
航点,其他约束将得到满足。来自文档的参考:
destinationN:中间目的地,至少一个。如果未提供结束参数,则选择这些值之一作为序列的结束。