Search code examples
javascriptcurlroutesmapsosrm

Negative Longitude in OSRM WebAPI parameters


This is not exactly a programming questions because i am being shot down at the first step.

I am trying to get Shortest path between Denver and New Jersey and using the URL:
http://router.project-osrm.org/route/v1/driving/39.636111,-105.044410;40.665955,-74.115622?overview=full&steps=true

It gives me error as shown:

{"message":"Invalid coordinate value.","code":"InvalidValue"}

Any idea what is going wrong here ? Please be kind to me and help me. :)

Thanks in advance


Solution

  • Got it, had to swap Lon and Lat,

    The correct URL is:

    http://router.project-osrm.org/route/v1/driving/-105.044410,39.636111;-74.115622,40.665955?steps=true&overview=simplified