Google API

Well Google doesn’t like you to use their maps api unless you pay them 10 grand for enterprise use, so we decided to go a slightly different route. The problem was that G blocked the service to our IP address for 24 hours after repeatedly using the service. Thanks G!

 Instead of using the API we used the Google maps online service, passing the address as part of a query string and then parsing the results. Although this is a pain to have to parse the resulting html from the service, it still works and the results ate consistent, although, be aware, the lat and long results from the API are different than from!

Here’s how to do it in .NET

‘first we create a request
Dim req As HttpWebRequest = CType(WebRequest.Create(“” + paddress), HttpWebRequest)
req.Method =
‘set the content length of the string being posted
‘create the stream amd write it and close
req.ContentLength = 0
req.ContentType =
‘now get the response
Dim res As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse)

‘read it into a stream and close
Dim sr As New System.IO.StreamReader(res.GetResponseStream)
PostGEOOut = sr.ReadToEnd

Once you have the resulting html you will need to parse it to get the results. I will post that code soon


, , , , , , , , ,

No comments yet.

Leave a Reply