Optimized route: one stop is causing 504 Gateway Timeout errors

10 posts / 0 new
Last post
compliancepublishing
Optimized route: one stop is causing 504 Gateway Timeout errors

This lat/lng combo is causing problems: 38.888665,-77.127688

Whenever I put in a get request for an optimized route involving this point, it either takes a really long time to calculate, or I get a 504 Gateway Timeout error. If it actually does finish calculating, the return is a condensed version and I can't work with it in certain ways (like using addRoute to draw a line between points).

Here is an example url with our key removed to illustrate the wonky return:

open.mapquestapi.com/directions/v2/optimizedroute?key=blahblahblah&json={locations:[{latLng:{lat:39.437317,lng:-76.773220}},{latLng:{lat:38.930770,lng:-77.178020}},{latLng:{lat:38.870270,lng:-77.167610}},{latLng:{lat:38.862790,lng:-77.085520}},{latLng:{lat:38.888665,lng:-77.127688}},{latLng:{lat:38.751970,lng:-77.082690}}]}

But if I take out the offending lat/lng and insert it with an address next door it works exactly as expected: 38.88806,-77.12804

So replacing the point gives us a url of:

open.mapquestapi.com/directions/v2/optimizedroute?key=blahblahblah&json={locations:[{latLng:{lat:39.437317,lng:-76.773220}},{latLng:{lat:38.930770,lng:-77.178020}},{latLng:{lat:38.870270,lng:-77.167610}},{latLng:{lat:38.862790,lng:-77.085520}},{latLng:{lat:38.88806,lng:-77.12804}},{latLng:{lat:38.751970,lng:-77.082690}}]}

This return is robust and is as expected, and the processing time is a fraction of the problem url.

Then I was able to get a visual look see at the street numbers from Here maps, and found that the point that is causing problems might be in a unique situation where it does not necessarily touch the street that it is supposed to be on. The address of the problem point is 1635 N George Mason Dr, Arlington, VA 22205. The address next door that works great is 1625. Here is a url that shows 1635 being off on an island a bit: https://wego.here.com/directions/mix//1635-N-George-Mason-Dr,-Arlington,...

Can someone explain to me what is happening here? Is this a bug, known bug? Thanks in advance.

 

 


MQBrianCoakley
Have you tried it with the
Have you tried it with the licensed routing rather than the open routing using www.mapquestapi.com? This uses more routing data than just OSM.

compliancepublishing
The switch seems to be

The switch seems to be working well. Thank you. Is there a link somewhere that explains the difference between the two? And do both services use the same amount of transactions in the request? I can't seem to find these answers.

Thanks again.


MQBrianCoakley
Both the licensed and open
Both the licensed and open versions count transactions the same way. The difference is that the open service uses OSM data while the licensed service uses OSM as a backup for licensed data. So the licensed version is more likely to have the correct data.

freund
I'm running into the same Problem

Hi,

I'm running into the same problem.

This Works

http://www.mapquestapi.com/directions/v2/optimizedroute?key=<Key>&doReve...

But when I only double the last point like

http://www.mapquestapi.com/directions/v2/optimizedroute?key=<Key>&doReve...

I get

{"fault":{"faultstring":"Gateway Timeout","detail":{"errorcode":"messaging.adaptors.http.flow.GatewayTimeout"}}}

 

Same with this

this works

http://open.mapquestapi.com/directions/v2/optimizedroute?key=<Key>&doRev...

This not

http://open.mapquestapi.com/directions/v2/optimizedroute?key=<Key>&doRev...


MQBrianCoakley
That's a head-scratcher. I
That's a head-scratcher. I sent this on to the development team to investigate. Thanks for the information.   3397

freund
News?

Hi,

any news in this case?

 

Regards, Christian


MQBrianCoakley
Hi Christian,
Hi Christian,   No, no updates at this time.

freund
Hi Brian,

any news?
 


MQBrianCoakley
Nope. This has not been put
Nope. This has not been put into a development cycle yet.   In the meantime, the locations can be checked for duplicates before using in the optimized route request. Also, a non-optimized route works great with the duplicate location.