[英]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.