Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
980 views
in Technique[技术] by (71.8m points)

here api - Unable To Get Multiple "before" Constraints To Work

I'm using the FindSequence API with the following waypoints:

&destination1=Stop-20712;-33.878683,151.1377808;st:7200;before:destination3;before:destination4
&destination2=Stop-20714;-33.8021024,150.9552574;st:7200;before:destination3;before:destination4
&destination3=Stop-20710;-33.9486425,151.080674;st:7200
&destination4=Stop-20711;-33.8929182,151.0596753;st:7200

The goal is to always have destination1 and destination2 as the first waypoints, however it does not appear to work. Here is the result:

"results": [
      {
         "waypoints": [
            {
               "id": "start-0",
               "lat": -33.97943,
               "lng": 150.86694,
               "sequence": 0,
               "estimatedArrival": null,
               "estimatedDeparture": "2021-01-06T08:30:00+10:00",
               "fulfilledConstraints": []
            },
            {
               "id": "Stop-20710",
               "lat": -33.948643,
               "lng": 151.08067,
               "sequence": 1,
               "estimatedArrival": "2021-01-06T08:46:32+10:00",
               "estimatedDeparture": "2021-01-06T10:46:32+10:00",
               "fulfilledConstraints": [
                  "st:7200"
               ]
            },
            {
               "id": "Stop-20714",
               "lat": -33.8021,
               "lng": 150.95526,
               "sequence": 2,
               "estimatedArrival": "2021-01-06T11:16:06+10:00",
               "estimatedDeparture": "2021-01-06T13:16:06+10:00",
               "fulfilledConstraints": [
                  "st:7200",
                  "before:destination4"
               ]
            },

It appears the waypoint "Stop-20714" has only taken into account a single before constraint. Am I missing something?

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

My mistake, Here support set me straight. The constraint should actually be comma delimited

&destination1=Stop-20712;-33.878683,151.1377808;st:7200;before:destination3,destination4

It's all good now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...