views:

152

answers:

3

I am getting user input into a python application of a local landmark. With this data I am trying to get the longitude and latitude of their object using Google maps. I am trying to work with the Google gdata api for the maps but I did not find a way to get long and lat data from a search query when working in python.
I am ok using any system that will solve my problem in python.

+1  A: 

You can use geopy (http://code.google.com/p/geopy/wiki/GettingStarted). It can query Google and several additional services.

Simon
+3  A: 

Are you trying to geocode a street or POI (point of interest)? In that case, geopy is perfect:

In [1]: from geopy import geocoders

In [2]: g = geocoders.Google(GOOGLE_MAPS_API_KEY)

In [3]: (place, point) = g.geocode('Eiffel Tower, Paris')
Fetching http://maps.google.com/maps/geo?q=Eiffel+Tower%2C+Paris&output=kml&key=XYZ...

In [4]: print point
------> print(point)
(48.858204999999998, 2.294359)
piquadrat
A: 

I have a JQuery Plugin that will allow you to plot multiple addresses from a json object. In my demo, I load the json object from a php file, so I'm sure that you can do the same with python.

http://grasshopperpebbles.com/ajax/jquery-plugin-imgooglemaps-0-9-multiple-addresses-street-view/

Les Green