How to find the distance for one source location to multiple destination locations in single API call?

7 posts / 0 new
Last post
srparlapalli4@g...
How to find the distance for one source location to multiple destination locations in single API call?

 

For example

My source location is A

My destination locations are B,C,D,E

 

I need to find the distance from

A -->B

A-->C

A-->D

A-->E

Through  one mapquest API call I want to get all these distance. I don’t want to call the mapquest API for 4 times as per this example.

 


MQBrianCoakley
This is exactly what the
This is exactly what the route matrix is designed to do: one request, many route distances and times.

srparlapalli4@g...
Thanks.This is what i was

Thanks.This is what i was looking for


srparlapalli4@g...
How to remove locatopn part from the response xml?

This is my request json and iam getting the response xml and json correctly.but in the response xml i dont need the locations where it will show the inputs we gave.how can i hide that part from the response xml?

{
"locations": [
"Denver, CO",
"Westminster, CO",
"Boulder, CO"
],
"options": {
"allToAll": true
}
}

this part in response xml
<locations>

<location>
<street/>
<adminArea5 type="City">Denver</adminArea5>
<adminArea3 type="State">CO</adminArea3>
<adminArea4 type="County">Denver County</adminArea4>
<postalCode/>
<adminArea1 type="Country">US</adminArea1>
<geocodeQuality>CITY</geocodeQuality>
<geocodeQualityCode>A5XAX</geocodeQualityCode>
<dragPoint>false</dragPoint>
<sideOfStreet>N</sideOfStreet>
<displayLatLng>
<latLng>
<lat>39.738453</lat>
<lng>-104.984853</lng>
</latLng>
</displayLatLng>
<linkId>282041090</linkId>
<type>s</type>
<latLng>
<lat>39.738453</lat>
<lng>-104.984853</lng>
</latLng>
</location>
<location>


MQBrianCoakley
The locations node is part of
The locations node is part of the response. There is no parameter to remove it. I'm curious why you would want that to be removed. It's not a significant strain on network response time for its additional file size, is it?   And please don't ask the same question in five places in the same forum.

srparlapalli4@g...
Iam storing all the response

Iam storing all the response payload in my database column and the response is too large and if i remove locations node that would be good


MQBrianCoakley
The locations node could be
The locations node could be removed from the result by finding that part of the result string and removing it.   Keep in mind that storage of api results is strictly agains the Terms & Conditions item c (Restrictions) a (General Restrictions: The customer shall not:) f (store or cache any MapQuest data).