Reading Google Maps matrix result

smig

Registered User.
Local time
Today, 19:26
Joined
Nov 25, 2009
Messages
2,209
I'm trying the google maps matrix to calculate Distance and time of travel.

I send it using an HTTP, and it seems to work fine

How do I read the the XML result?
Code:
<DistanceMatrixResponse>
<status>OK</status>
<origin_address>Jerusalem, Israel</origin_address>
<destination_address>Tel Aviv, Israel</destination_address>
<row>
<element>
<status>OK</status>
<duration>
<value>1675</value>
<text>50 min</text>
</duration>
<distance>
<value>25277</value>
<text>52 km</text>
</distance>
</element>
</row>
</DistanceMatrixResponse>
 
smig,

You may get some ideas from this older post
Driving Distance Between 2 zip.
See the later entries in the thread where there is reference to info on some changes made by Google that affects databases in the thread.
 
Additionally you should read up on Xpath, this is what Google recommends for parsing the result.
 

Users who are viewing this thread

Back
Top Bottom