I want the optimize endpoint to take into account an arrival time interval and a service duration, but it seems the optimized route isn’t taking this information into account. I’ve entered two stops very close together with a schedule that could be run, but the response doesn’t reflect this:
import requests
body = {"jobs":[{"id":0,"location":[-2.97823,43.31614],"time_window":["09:00","09:30"],"service":1800},{"id":1,"location":[-2.981079,43.325137],"time_window":["07:30","08:00"],"service":900}],"vehicles":[{"id":0,"profile":"driving-car","start":[-2.94657,43.30188],"end":[-2.92442,43.3002],"departure":"07:00","arrival":"15:00"}]}
headers = {
'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
'Authorization': 'TU_API_KEY',
'Content-Type': 'application/json; charset=utf-8'
}
call = requests.post('https://api.openrouteservice.org/optimization', json=body, headers=headers)
print(call.status_code, call.reason)
print(call.text)