exceptions.ApiError , code 2099


#1

Hi,
I tried the following Code and it worked with the first coordinates (from Heidelberg)

import openrouteservice
from openrouteservice import convert

coords = ((49.397645, 8.689543),(49.388036, 8.690433))
client = openrouteservice.Client(key=’*****’) #just hide my token
geometry = client.directions(coords)[‘routes’][0][‘geometry’]
decoded = convert.decode_polyline(geometry)
print(decoded[“coordinates”])

but when I replace it with the following coordinates (from Sud Korea), it didn’t work:

import openrouteservice
from openrouteservice import convert

coords = ((36.253527, 128.228179),(36.251456, 128.254312))
client = openrouteservice.Client(key=’*****’) #just hide my token
geometry = client.directions(coords)[‘routes’][0][‘geometry’]
decoded = convert.decode_polyline(geometry)
print(decoded[“coordinates”])

I get this Error:

Traceback (most recent call last):
File “openroute.py”, line 19, in
geometry = client.directions(coords)[‘routes’][0][‘geometry’]
File “/home/vtd/anaconda3/lib/python3.6/site-packages/openrouteservice/client.py”, line 289, in wrapper
result = func(*args, **kwargs)
File “/home/vtd/anaconda3/lib/python3.6/site-packages/openrouteservice/directions.py”, line 247, in directions
return client.request("/v2/directions/" + profile + ‘/’ + format, {}, post_json=params, dry_run=dry_run)
File “/home/vtd/anaconda3/lib/python3.6/site-packages/openrouteservice/client.py”, line 206, in request
result = self._get_body(response)
File “/home/vtd/anaconda3/lib/python3.6/site-packages/openrouteservice/client.py”, line 239, in _get_body
body
openrouteservice.exceptions.ApiError: 500 ({‘error’: {‘code’: 2099, ‘message’: None}, ‘info’: {‘engine’: {‘version’: ‘5.0.2’, ‘build_date’: ‘2019-09-20T13:57:05Z’}, ‘timestamp’: 1569949231476}})

I also tried coordinates from China and India and I got the same Error.
Could you please help me !


#2

[lon, lat], not [lat, lon]


#3

already taken in consideration. It’s not the problem!


#4

Then please update your question with smth reproducible.

coords = ((36.253527, 128.228179),(36.251456, 128.254312))

This is not [lon, lat], but [lat, lon], i.e. wrong order.

The same for the HD example, just that the wrong order happens to actually exist apparently. 128 deg North is not valid though.


#5

Thanks, it worked now. I really have to work with [lon, lat]. I didn’t take it in consideration in the rest of my program. But now I did and that was the Problem.