通过 ggmap
可以访问谷歌地球图像有一个非常好的界面。 .例如:
ggmap::get_map(location = c(lon = -95.3632715, lat = 29.7632836),
maptype ="satellite",zoom=20)
将从 Google Maps/Earth 返回卫星 map 图像。在谷歌地图网站上,如果你再放大一点,它会切换到街景。 R 是否有类似的方法来获取街景图像?
似乎确实有一个 API ,但找不到类似于
ggmap
的任何内容R中的接口(interface)。
最佳答案
我的 googleway
包有一个谷歌地图小部件(也可以使用 with Shiny )。
您需要一个有效的 Google API key 才能使用它
library(googleway)
key <- "your_api_key"
df <- data.frame(lat = -37.817714,
lon = 144.967260,
info = "Flinders Street Station")
google_map(key = key, height = 600, search_box = T) %>%
add_markers(data = df, info_window = "info")
## other available methods
# add_markers
# add_heatmap
# add_circles
# add_traffic
# add_bicycling
# add_transit
卫星
卫星/街道
街景
(注意标记仍然存在)
更新 - 静态街景 map
还有一个
google_streetview()
将下载静态街景图像的函数(使用 Google 街景静态图像 API)google_streetview(location = c(-37.8177, 144.967),
size = c(400,400),
panorama_id = NULL,
output = "plot",
heading = 90,
fov = 90,
pitch = 0,
response_check = FALSE,
key = key)
关于r - 一种从 R 访问谷歌街景的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39197022/