Edit 1:
- Added "TimeWindowStart1" and "TimeWindowEnd1" to depot in UTC
Now, the date returned is the correct date but its started at 8.00am.
According to the documentation,
"EarliestStartTime" & "LatestStartTime"
cannot be null on the routes. If its null, "EarliestStartTime" will default to 8.00AM and "LatestStartTime" will default to 10.00AM.
However, regardless of whether I pass in as EPOCH time or UTC time or just time for both that parameters (11.00am), the result still shows at 8.xxAM
*weird
===============================================================================================================
Hi.
This is in regards to VRPS (Vehicle Routing Problem Service)
I am not clear if its something that I have done incorrectly but here goes:
On (https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRoutingProblem/GPServer/SolveVehicleR... ), the following is some of my POST request body param:
default_date: Time.now.to_i, (ruby in seconds)
time_units: 'Seconds',
distance_units: 'Meters'
depot: (total number of depots entered: 1)
{
"features": [
{
"geometry": {
"x": 103.963887,
"y": 1.334828
},
"attributes": {
"Name": "ABC"
"TimeWindowStart1": "Time in UTC"
"TimeWindowEnd1": "Time in UTC"
}
}
]
}
orders: (total number of orders entered = 21, all with the same structure as below)
{
"features": [
{
"geometry": {
"x": 103.947531,
"y": 1.356423
},
"attributes": {
"Name": "location_one"
}
}, {...}, ...
]
}
route: (total number of routes entered = 8, all with the same structure as below)
{
"features": [
{
"attributes": {
"Name": "vehicle_one",
"StartDepotName": "ABC",
"EarliestStartTime": 1453604400, (24 Jan 2016, 11am - local time)
"LatestStartTime": 1453604400
}
}, {...},...
]
}
In the response:
output orders:
- value.features.attributes.Name = "location_one"
- value.features.attributes.ArriveTime = 1454185449 (31st January 2016, 4.24pm - it takes > 1 day to reach here but in actual fact, it takes less than 30 minutes to reach this location from the starting depot location or less than 1 day to reach from anywhere within the country)
However, for output routes's "TotalTravelTime": 1355.3337866440415 seconds (assuming its seconds cause thats what I passed in) which equates to about 22 minutes
Weird.
*Totally have no clue
Would appreciate if anyone could provide a solution to my problem (or even a clue/hint)
Solved! Go to Solution.
The solution is that:
Regardless of "time_unit", all the timing entered has to be in EPOCH time in milliseconds.
UTC time don't work.
EPOCH in seconds don't work.
All timing here refers to timing on the depot as well as on each route.
Is it an issue of converting between UTC and local time? Try converting local time to UTC before calling the routing service, then convert the routing response back to local time.
Hey Randy. I did as you said but yet still face another issue. Have editted the question.
The solution is that:
Regardless of "time_unit", all the timing entered has to be in EPOCH time in milliseconds.
UTC time don't work.
EPOCH in seconds don't work.
All timing here refers to timing on the depot as well as on each route.