views:

1127

answers:

3

Hi, 1. I have a VB .NET windows App

  1. I have two locations: StartPoint = "Minneapolis MN US" EndPoint = "Dallas TX US"

  2. I want to call Google Map API's GDirections.load(xxx) and GDirections.getDistance() and get (Expecting) some XML formatted data that will give me the Distance between the two locations.

I can probably use VB .NET webrequest object and call a URI and get html stream, then parse through HTML codes to get the Distance, I don not want to do that. I wan to call and consume as a web service.

Can some one please help? Many thanks.

**On the side note, everytime I come to ask something on this site I create a new ID. I just am not intelligent enough to use this OpenId thing. My ID = MehdiAnis here but now I can't log in using that ID. I am frustrated. I know if I close this window, I will have to recreate another ID to ask another question.
+1  A: 

The Google Maps APi is intended to be used on a web page. Their Terms of Service is written to support the implementation of the API through a publicly available web site.

Jacob Ewald
A: 

Thanks for the answer. After trying and searcing a lot finally I gave up. But thank you for telling me the reason why I could not make it happened as it was not made for that reason.

But, really needed to get distances between 3K places - A 3kx3k matrix. Finding no other choice I went for BruteForceAttack. Programmatically create a URL that would show the distance for A to B, programmatically read the resulting HTML, parse the text, scrub the particular data I need.

It takes time but I need to get the 3kx3k distances only once. Is there any other FREE map Web Service that would give distance between two places?

Thanks.

Mehdi Anis

Mehdi Anis
A: 

This Stack Overflow answer may be of some help: http://stackoverflow.com/questions/115850/what-pre-existing-services-exist-for-calculating-distance-between-two-addresses/115902#115902

You'll probably be better off just running the calculations yourself and storing them in a data table. I assume you're not generating that matrix every time you need to use it.

Jacob Ewald
You are right it's a one time job to create the matrix ONCE. The requirement is to get the distance from GOOGLE. If I use Long/Lat for the From/To cities and calculate distance that will not work. And I am also conducting the matrix on a NON North American Country. I have created a .NET app, running 24/7 from different locations to scrub the distances - a brute force attack. Google do block IP if i run multiple instances of the app or from multiple machine sharing same IP.Thanks for your information, it's valuable.
Mehdi Anis