【发布时间】:2015-08-01 17:27:10
【问题描述】:
我正在尝试对地址列表进行地理编码,但我遇到了一些 INVALID_REQUEST 错误,但我不知道为什么。看看这个:
# First check if I have permission:
geocodeQueryCheck()
2478 geocoding queries remaining.
# Enter data
d <- c("Via del Tritone 123, 00187 Rome, Italy",
"Via dei Capocci 4/5, 00184 Rome, Italy")
# Ensure it's a character vector
class(d)
[1] "character"
# Try to geocode
library(ggmap)
geocode(d)
lon lat
1 NA NA
2 12.49324 41.89582
Warning message:
geocode failed with status INVALID_REQUEST, location = "Via del Tritone 123, 00187 Rome, Italy"
# Obtain an error, but if I try directly:
geocode("Via del Tritone 123, 00187 Rome, Italy")
lon lat
1 12.48813 41.90352
# It works. What gives?
【问题讨论】:
-
它对我有用:
packageVersion("ggmap") [1] ‘2.4’ -
我也有 v.2.4。加载直接地理编码后,它会将结果缓存在某处,因此
geocode(d)不会返回任何警告...geocode(d)是否立即为您工作? -
正如我之前提到的,它对我有用。在新会话中尝试。