我想使用ggmap::geocode()
来获取不同位置的坐标,但由于未知原因,调用似乎意外失败。我没有超过查询限制,如下面的尝试所示,我正在尝试地理编码的地址是有效的。
> geocodeQueryCheck()
2494 geocoding queries remaining.
> geocode("McGill University Montreal", output = "latlon")
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=McGill%20University%20Montreal&sensor=false
lon lat
1 NA NA
Warning message:
geocode failed with status OVER_QUERY_LIMIT, location = "McGill University Montreal"
> geocode("McGill University Montreal", output = "latlon")
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=McGill%20University%20Montreal&sensor=false
lon lat
1 -73.57715 45.50478
> geocodeQueryCheck()
2492 geocoding queries remaining.
> paste(geocode("McGill University Montreal", output = "latlon"), collapse = " ")
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=McGill%20University%20Montreal&sensor=false
[1] "NA NA"
Warning message:
geocode failed with status OVER_QUERY_LIMIT, location = "McGill University Montreal"
> paste(geocode("McGill University Montreal", output = "latlon"), collapse = " ")
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=McGill%20University%20Montreal&sensor=false
[1] "-73.5771511 45.5047847"