r - 一种从 R 访问谷歌街景的方法?

标签 r google-street-view ggmap

通过 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

卫星

enter image description here

卫星/街道

enter image description here

街景

(注意标记仍然存在)

enter image description here

更新 - 静态街景 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)

enter image description here

关于r - 一种从 R 访问谷歌街景的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39197022/

相关文章:

r - 在 R 中使用 ggmap 在 get_map 中出错

r - ggmap 缺少背景图(使用 pdf 设备时除外)

r - min 和 max 没有非缺失参数

r - 如何在 R 中连接复合语言对象?

optimization - R:FAST 多变量优化包?

iOS GoogleMaps StreetView URL Scheme with Heading and Pitch

ios - 为什么某些坐标(纬度和经度)不适用于 Google Maps SDK for iOS API?

r - 对方阵进行排序

r - 如果我提供了错误命名的参数,则会触发有用的错误

android - 查询给定区域中包含全景图的商业场所的api?