Cannot find point with negatives cords


#1

Hi,
i’m trying to get a basic route between two points in python, like this:

openrouteservice points

But in python and API playground page i always get this error message:
“Cannot find point 0: -56.138763,-34.75064; Cannot find point 1: -56.171722,-34.831841”

These points are from Montevideo, Uruguay. I don’t know what is wrong :frowning:

I use the example code:

import openrouteservice
from openrouteservice import convert
coords = ((-34.75064, -56.138763),(-34.831841, -56.171722))
client = openrouteservice.Client(key=‘myapi_key’)
geometry = client.directions(coords)[‘routes’][0][‘geometry’]
decoded = convert.decode_polyline(geometry)
print (decoded)


#2

ORS (like any other sensible app;)) uses [lon, lat], not [lat, lon] for coordinates. Reverse the coords and it should work.