The following geocoding exercise will pull information from google using the address for the college of business which is 300 West Michigan Ave, Ypsilanti, MI
The first part of the process is to send the geocoding request using a REST request
http://maps.google.com/maps/geo?q=300+West +Michigan+Ave,+Ypsilanti,+MI&output=xml&oe=utf8&sensor=false&key=ABQIAAAAE7hs30ymlAm_4X305SntMRSvMRu_uxOrKH4eiP-mAjD5A6ggehSGm3tWp7Lc7PqCeEkyzlWZ5b1fww
Code Broken Down
Queried URL
http://maps.google.com/maps/geo?
This is the address that you want to retrieve coordinates for
q=300+West +Michigan+Ave,+Ypsilanti,+MI
This is the type of output file you want the data to be return in
output=xml (If you prefer a JSON format you can replace xml with JSON in this part of the string)
Encoding format of the response
oe=utf8
indicates whether the request is coming from a device embedded with a location sensor
sensor=false
This is where you put in your unique google key that is licensed for your website
key=insert your google key here
The outputted response is shown below:
Here is the XML file that returned from the query, as you can see at the bottom of the XML file the returned coordinates of the college of business is -83.6161001, 42.2411090
Here is the JSON file that was returned from the query, as you can see at the bottom of the JSON file the returned coordinates of the college of business is the same as the XML file
In the next blog post I will show you a basic way to use this coordinate to place a marker at this point on a google map
Enjoy!!