geopy简介
可以使用geopy库来查询地址,国家,城市,地标,geopy使用的是第三方的geo解析器(包括谷歌地图,必应地图,Nominatim等)和一些数据源来获取地理信息
Each geolocation service you might use, such as Google Maps, Bing Maps, or Yahoo BOSS, has its own class in geopy.geocoders
abstracting the service’s API. Geocoders each define at least ageocode
method, for resolving a location from a string, and may define a reverse
method, which resolves a pair of coordinates to an address.
geopy使用
从地址字符串获取Location
对象
|
|
从经纬度获取Location
对象
|
|
计算两点间距离
可以使用 Vincenty distance 或 great-circle distance
|
|
|
|
各三方地理服务API
ArcGIS
class
geopy.geocoders.ArcGIS
(username=None, password=None, referer=None, token_lifetime=60,scheme=’https’, timeout=1, proxies=None, user_agent=None)
Baidu
class
geopy.geocoders.Baidu
(api_key, scheme=’http’, timeout=1, proxies=None, user_agent=None)
Bing
class
geopy.geocoders.Bing
(api_key, format_string=’%s’, scheme=’https’, timeout=1, proxies=None,user_agent=None)
DataBC
class
geopy.geocoders.DataBC
(scheme=’https’, timeout=1, proxies=None, user_agent=None)
GeocodeFarm
class
geopy.geocoders.GeocodeFarm
(api_key=None, format_string=’%s’, timeout=1, proxies=None,user_agent=None)
GeocoderDotUS
class
geopy.geocoders.GeocoderDotUS
(username=None, password=None, format_string=’%s’,timeout=1, proxies=None, user_agent=None)
GeoNames
class
geopy.geocoders.GeoNames
(country_bias=None, username=None, timeout=1, proxies=None,user_agent=None)
GoogleV3
class
geopy.geocoders.GoogleV3
(api_key=None, domain=’maps.googleapis.com’, scheme=’https’,client_id=None, secret_key=None, timeout=1, proxies=None, user_agent=None)
IGNFrance
class
geopy.geocoders.IGNFrance
(api_key, username=None, password=None, referer=None,domain=’wxs.ign.fr’, scheme=’https’, timeout=1, proxies=None, user_agent=None)
LiveAddress
class
geopy.geocoders.LiveAddress
(auth_id, auth_token, candidates=1, scheme=’https’, timeout=1,proxies=None, user_agent=None)
NaviData
class
geopy.geocoders.NaviData
(api_key=None, domain=’api.navidata.pl’, timeout=1, proxies=None,user_agent=None)
Nominatim
class
geopy.geocoders.Nominatim
(format_string=’%s’, view_box=None, country_bias=None, timeout=1,proxies=None, domain=’nominatim.openstreetmap.org’, scheme=’https’, user_agent=None)
OpenCage
class
geopy.geocoders.OpenCage
(api_key, domain=’api.opencagedata.com’, scheme=’https’, timeout=1,proxies=None, user_agent=None)
OpenMapQuest
class
geopy.geocoders.OpenMapQuest
(api_key=None, format_string=’%s’, scheme=’https’, timeout=1,proxies=None, user_agent=None)
Photon
class
geopy.geocoders.Photon
(format_string=’%s’, scheme=’https’, timeout=1, proxies=None,domain=’photon.komoot.de’)
YahooPlaceFinder
class
geopy.geocoders.YahooPlaceFinder
(consumer_key, consumer_secret, timeout=1, proxies=None,user_agent=None)
What3Words
class
geopy.geocoders.What3Words
(api_key, format_string=’%s’, scheme=’https’, timeout=1,proxies=None, user_agent=None)
Yandex
class
geopy.geocoders.Yandex
(api_key=None, lang=None, timeout=1, proxies=None, user_agent=None)