Python module for getting latitude and longitude from the name of a US city

Have a look at geopy. In the “getting started” documentation it shows:

>>> from geopy import geocoders  
>>> gn = geocoders.GeoNames()

>>> print gn.geocode("Cleveland, OH 44106")
(u'Cleveland, OH, US', (41.4994954, -81.6954088))

>>> gn.geocode("Cleveland, OH", exactly_one=False)[0]
(u'Cleveland, OH, US', (41.4994954, -81.6954088))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)