0
votes

Here - > https://maps.google.com/ I queried for parameters A : antim chauraha, Indore, Madhya Pradesh, India B : India Collection, Indore, Madhya Pradesh, India

And using the webservice to get as XML, same response from Direction API

http://maps.googleapis.com/maps/api/directions/xml?origin=ANTIM%20CHAURAHA,Indore,Madhya%20Pradesh,India&destination=INDIA%20COLLECTION,PALSIKAR,Indore,Madhya%20Pradesh,India&sensor=false

Those responses do not match at all. You see the distance, direction or anything.

Am I doing something wrong?

2

2 Answers

1
votes

Google Maps uses additional information to locate your "query string". The directions API uses postal addresses (for the most part).

Neither of these looks like a particularly good "address" A : antim chauraha, Indore, Madhya Pradesh, India B : India Collection, Indore, Madhya Pradesh, India

Run them through the Google Maps API v3 geocoder, they both resolve to the same place (Indore, Madhya Pradesh, India)

If you need to resolve "places" like that, use the Places API to get coordinates, then use the directions service to get directions between the coordinates.

0
votes

Basically there is a difference in name and address. Google database can have other symbols for the same location. You can read my answer here: http://www.stackoverflow.com/questions/12788664/google-maps-api-geocode-returns-different-co-ordinates-then-google-maps/12790012#12790012. In the google response the name is what you are looking for and in the placemark object the list of address and location in the google database. You need to loop through the placemark object to find the most similar location.