tmap / tmaptools geocode_OSM函数错误

问题描述

我有一个约2050个地址的数据框,我想使用geocode_OSM函数进行地理编码。数据帧(df)包含一个ID列和一个地址列。

library(tmaptools)
library(tmap)
library(geosphere)
geocoded_addresses <- geocode_OSM(df$address_column,as.data.frame = TRUE)

上面的代码昨天有效,但是今天当我运行相同的代码时,出现以下错误:

  cannot open URL 'http://nominatim.openstreetmap.org/search?q=127+Public+Square,+Cleveland,+OH+44114&format=xml&polygon=0&addressdetails=0'

即使我运行了简单的代码行,例如geocode_OSM("Milan,Italy"),我也会收到相同的错误。

Error in download.file(addr[k],destfile = tmpfile,mode = "wb",quiet = TRUE) : 
  cannot open URL 'http://nominatim.openstreetmap.org/search?q=Milan,+Italy&format=xml&polygon=0&addressdetails=0'

请帮助我,我不知道为什么这不起作用!

这是我唯一能够找到的关于此错误的信息,但是它对我没有帮助,因为我的文件中没有变音符号:https://github.com/mtennekes/tmap/issues/66

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)