Unable to calculate route Or calculated route if locations inverted

6 posts / 0 new
Last post
Etienne Rutten
Unable to calculate route Or calculated route if locations inverted

Hello support,

 

I dont understand why passing this url :

https://www.mapquestapi.com/directions/v2/route?json={locations:["50.20396083,5.340502281","50.45333,3.94874"]}&outFormat=xml&key=xxxxxxxxxxxx

=> I receive a "Unable to calculate route" message,

But if i inverse the locations so the url becomes :
https://www.mapquestapi.com/directions/v2/route?json={locations:["50.45333,3.94874","50.20396083,5.340502281"]}&outFormat=xml&key=xxxxxxxxxxx 

=> The route is calculated 

 

What am i missing ?

 

Thanks !

 


MQBrianCoakley
Are you still having trouble
Are you still having trouble with this route? It's working in both directions for me.

Etienne Rutten
Hello, 

Hello, 

 

Thank you for helping me. I tried today but I receive the same answer :

https://www.mapquestapi.com/directions/v2/route?json={locations:[%2250.20396083,5.340502281%22,%2250.45333,3.94874%22]}&outFormat=xml&key=

 

<response>

<info>

<statusCode>602</statusCode>

<messages>

<message>200 Unable to calculate route.</message>

</messages>

<copyright>

<imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl>

<imageAltText>© 2019 MapQuest, Inc.</imageAltText>

<text>© 2019 MapQuest, Inc.</text>

</copyright>

</info>

<routeError>

<errorCode>202</errorCode>

<message/>

 

 

https://www.mapquestapi.com/directions/v2/route?json={locations:[%2250.45333,3.94874%22,%2250.20396083,5.340502281%22]}&outFormat=xml&key=

response>

<info>

<statusCode>0</statusCode>

<messages/>

<copyright>

<imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl>

<imageAltText>© 2019 MapQuest, Inc.</imageAltText>

<text>© 2019 MapQuest, Inc.</text>

</copyright>

</info>

<routeError>

<errorCode>-400</errorCode>

<message/>

</routeError>

<route>

<sessionId>5e1ecffa-02c9-4ee4-02b4-22f8-0a32ae38eb63</sessionId>

<options>

<shapeFormat>raw</shapeFormat>

<generalize>-1.0</generalize>

<maxLinkId>0</maxLinkId>


MQBrianCoakley
There is something happening
There is something happening when the reverse geocode is performed. Are you able to set doReverseGeocode to false? It seems to work fine with that and I'm not sure why.

Etienne Rutten
Wtih this url : https://www

Wtih this url : https://www.mapquestapi.com/directions/v2/route?json={locations:[%2250.20396083,5.340502281%22,%2250.45333,3.94874%22]}&doReverseGeocode=false&outFormat=xml&key=xxxxxxx

I still get the same error ...

Is it the right way to use the doReverseGeocode option ?

Thanks

 

 

 

 


MQBrianCoakley
The doReverseGeocode needs to
The doReverseGeocode needs to be in an options object within the JSON. {locations:["50.20396083,5.340502281","50.45333,3.94874"],options:{doReverseGeocode:false}} ought to work.