我正在使用 Python 库的 Google 地理编码 API(尝试过 GeoPy 1.11.0)。对于诸如“Utica”之类的查询,我得到一个响应:
{u'geometry': {u'location_type': u'APPROXIMATE', u'bounds': {u'northeast':
{u'lat': 43.132269, u'lng': -75.1609059}, u'southwest': {u'lat':
43.0644689, u'lng': -75.295296}}, u'viewport': {u'northeast': {u'lat':
43.132269, u'lng': -75.1609059}, u'southwest': {u'lat': 43.0644689, u'lng':
-75.295296}}, u'location': {u'lat': 43.100903, u'lng': -75.232664}},
u'address_components': [{u'long_name': u'Utica', u'types': [u'locality',
u'political'], u'short_name': u'Utica'}, {u'long_name': u'Oneida County',
u'types': [u'administrative_area_level_2', u'political'], u'short_name':
u'Oneida County'}, {u'long_name': u'New York', u'types':
[u'administrative_area_level_1', u'political'], u'short_name': u'NY'},
{u'long_name': u'United States', u'types': [u'country', u'political'],
u'short_name': u'US'}], u'place_id': u'ChIJKXZqNVE32YkRhvztGCY2GhE',
u'formatted_address': u'Utica, NY, USA', u'types': [u'locality',
u'political']} …Run Code Online (Sandbox Code Playgroud)