I am trying to request routes from 100 coordinates of client addresses (held in a csv file) to a single coordinate (a foodbank site)
import csv
import openrouteservice
client = openrouteservice.Client(key='myAPIkey')
with open ('ClientCoordinates.csv' , 'r') as csv_coords:
csv_reader = csv.reader(csv_coords)
EXTRA_COORD = (53.464774, 2.23179)
new_csv_coords = []
routelist = []
for line in csv_reader:
new_csv_coords.append(((float(line[0]), float(line[1])), EXTRA_COORD))
coords = (new_csv_coords)
print(coords[0])
routes = client.directions(coords[0])
print(routes)
This returns the error - Request parameters exceed the server configuration limits. The approximated route distance must not be greater than 6000000.0 meters.
My API token says I can perform 2000 requests, and I am only requesting 100 so I’m not sure what is going on. Thanks in advance for any help.
The error says that your requested route will be at least 6000km long and that exceeds the configuration limit (for a single request). Are your coordinates this far apart?
No, they are all within Manchester. What I think could be happening is that my code sends a request for a whole batch of 100 routes at once, rather than one by one - therefore exceeding the limit.