Hey,
Have setup a local instance of ORS with vroom trying to work on optimization. It is part of a code block that works on a list of coordinates that come from an online file. The code gets split based on areas, but only 1 car will service the areas. There are 6 areas, but the code fails after the first item of the area list throwing the code:2 Duplicate job id: 0. The code block is below:
for i in uni_areas:
cord_lst = []
for k in dfs[f'locs_{i}']['locs']:
k = ast.literal_eval(k)
cord_lst.append(k)
cord_lst = [[y, x] for x, y in cord_lst]
for idx, coord in enumerate(cord_lst):
jobs.append(optimization.Job(id = idx, location = coord))
vehicles = [optimization.Vehicle(id = 0, profile = 'driving-car', start = start_loc, end = start_loc)]
route = vroom.optimization(jobs = jobs, vehicles = vehicles, geometry = True)
print(route)
I get the below output when the loop moves to the 2nd region:
openrouteservice.exceptions.ApiError: 400 ({‘code’: 2, ‘error’: ‘Duplicate job id: 0.’})