Jump to content
Sign in to follow this  
bobetko

Google GeoCoding

Recommended Posts

bobetko

I need to make http request to this page:

(I also have to send parameters q, output, key)

http://maps.google.com/maps/geo?q=some+address,City,State&output=csv&key=MyGoogleKey

and be able to process result which is longitude and latitude separated with comma.

How do I do this with AutoIt 3.0

After some resarch I have this:

$ResolveTimeout = 5000
$ConnectTimeout = 5000
$SendTimeout = 5000
$ReceiveTimeout = 5000
$sUrl = "http://maps.google.com/maps/geo"
$PostData = "q=4400+Horizon+Hill,San+Antonio,TX&output=csv&key=MyGoogleKey"
$oHttpRequest = ObjCreate("MSXML2.ServerXMLHTTP")
$oHttpRequest.Open ("POST", $sUrl,True)
;$oHttpRequest.setRequestHeader  ("Content-Type", "application/x-www-form-urlencoded"); Need to change as per your webpage
$oHttpRequest.setRequestHeader  ("Content-Type", "text/plain");

$oHttpRequest.setRequestHeader  ("Connection", "Keep-Alive")
$oHttpRequest.Send ($PostData)
sleep(1000)

$strReturn = $oHttpRequest.responseText
MsgBox(4096, "Done", $strReturn);

But I am not getting proper response. Getting something, but now two numbers, latitude and longitude.

What I am doing wrong?

Thanks.

Edited by bobetko

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.