简体   繁体   English

如何快速从python中的地址获取经纬度?

[英]How to get the latitude and longitude from the address in python quickly?

I have used the code for finding the latitude and longitude from the given address:我已经使用代码从给定地址查找纬度和经度:

     locator = Nominatim(user_agent="myGeocoder")  # holds the Geocoding service, Nominatim
     geocode = RateLimiter(locator.geocode, min_delay_seconds=0.00000000000000000000000000000000000000000000000000000000000000000000000000001)
    data['MBR_location'] = data['MBR_Full_Address'].apply(lambda x: geocode(x))
     data['Prov_location'] = data['Prov_Full_Address'].apply(lambda x: geocode(x))

But it takes so much time to produce the latitude and longitude.但是生成纬度和经度需要花费很多时间。 For example, in this way, it needs 3 hours for getting the latitude and longitude from only 10k ID.比如这样,从10k个ID中获取经纬度需要3个小时。 Is there any way to get the results faster way?有什么方法可以更快地获得结果吗? Thanks in Advance!提前致谢!

I guess it takes so long because you are using OSM's public Nominatim instance and the usage policy only allows one request per second .我想这需要很长时间,因为您使用的是 OSM 的公共 Nominatim 实例,并且使用策略每秒只允许一个请求 So either switch to a different Nominatim instance or install your own local Nominatim server .因此,要么切换到不同的 Nominatim 实例,要么 安装您自己的本地 Nominatim 服务器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Django GeoIP中的经度和纬度获取地址? - How to get Address from Latitude & Longitude in Django GeoIP? 如何使用 python 获取纬度和经度 - How To Get Latitude & Longitude with python 从地址地理位置获取纬度和经度 - Get latitude & longitude from address geopandas 如何在 Python 中快速从 IP 地址列表中查找纬度/经度? - How to look-up Latitude/Longitude from list of IP addresses quickly in Python? 如何从 python 的经度和纬度获取邮政编码? - How do I get zipcodes from longitude and latitude on python? 如何快速将纬度和经度放在一列? - How put latitude and longitude in one column quickly? 如何通过地址获取经度和经度,而不会在python中出现太多请求错误 - How get latitude and longitude through address without too many requests error in python 如何从 Excel 文档(Python)读取的地址中查找经度和纬度? - How to find Longitude and Latitude from an Address Reading from an Excel doc (Python)? 将地址到经纬度的地理编码结果保存到Python中的原始dataframe - Save geocoding results from address to longitude and latitude to original dataframe in Python 使用纬度和经度从 DataFrame 的两列中获取地址? - Get address using Latitude and Longitude from two columns in DataFrame?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM