-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
24 lines (21 loc) · 942 Bytes
/
README
File metadata and controls
24 lines (21 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
An independent geocoder using Google Maps API v3 that does reverse geocoding and supports access through proxy.
Examples:
In [1]: from google import Google
In [2]: GOOGLE_KEY = None
In [3]: ggeocoder = Google(GOOGLE_KEY, output_format='json')
In [4]: address_str = "1600 Pennsylvania Ave, Washington DC"
In [5]: results = ggeocoder.geocode(address_str)
In [6]: results[0]
Out[6]: u'1600 Pennsylvania Ave NW, Washington, DC 20500, USA'
In [7]: results[1]
Out[7]: (38.8987149, -77.0376555)
In [8]: results[2].keys()
Out[8]: [u'geometry', u'address_components', u'partial_match', u'formatted_address', u'types']
In [9]: coord = (38.8987149, -77.0376555)
In [10]: results = ggeocoder.reverse(coord)
In [11]: results[0]
Out[11]: u'1600 Pennsylvania Ave NW, Washington, DC 20500, USA'
In [12]: results[1]
Out[12]: (38.8987149, -77.0376555)
In [13]: results[2].keys()
Out[13]: [u'geometry', u'address_components', u'formatted_address', u'types']