[英]How can I use python to get my lat,lon in OSM?
我已經嘗試使用地理編碼來獲取我的經緯度,但是不是最新的
它是通過我的IP轉換到lat,lon
可以幫助我osm(openstreetmap)api獲取我當前的經緯度嗎?
import geocoder
g = geocoder.ip('me')
print(g.latlng)
和
freegeoip = "http://freegeoip.net/json"
geo_r = requests.get(freegeoip)
geo_json = geo_r.json()
user_postition = [geo_json["latitude"], geo_json["longitude"]]
print(user_postition)
OpenStreetMap不提供地理位置API。 但是,您可以在Internet上找到各種地理位置服務和數據庫。 這里提到其中一些: https : //opendata.stackexchange.com/questions/2087/ip-geocoding-data-sources-and-or-apis
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.