R语言 从stamenmaps获取底图时出现新错误

vlju58qv  于 2023-10-13  发布在  其他
关注(0)|答案(1)|浏览(163)

我以前使用下面的代码从stamenmaps获取底图,但是我今天试着运行它,我得到了一个错误消息。如果我将缩放更改为<= 5的值,那么它会运行,但不会运行更高的值。

library(ggmap)
base <- get_stamenmap(bbox = c(left   = -70.2, 
                               bottom = 43.0,
                               right  = -49.8,
                               top    = 54.5), 
                        zoom = 8, maptype = "terrain-background", color = "color")
ℹ Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.
Error in f(init, x[[i]]) : 
  number of rows of matrices must match (see arg 2)
fhg3lkii

fhg3lkii1#

这是我发现从体育场Map获取雄蕊Map时间。

1)您需要获取API key
2)然后安装ggmap的dev版本,并更新R代码,添加新函数:

remove.packages("ggmap")
install.packages("devtools")
devtools::install_github("stadiamaps/ggmap")
library("ggmap")
register_stadiamaps(key = "INSERT YOUR KEY HERE")
atlCan <- get_stadiamap(bbox = c(left   = -70.2, 
                                 bottom = 43.0,
                                 right  = -49.8,
                                 top    = 54.5), 
                        zoom = 8, maptype = "stamen_terrain_background")

更多详情here .

相关问题