Open rssco opened 5 months ago
I had same issue but got the stamen_watercolor to work by installing from github using devtools::install_github("dkahle/ggmap"). Not sure why package version on CRAN is giving that error.
Hi, I am working with get_stadiamap and I would like to have the "stamen_watercolor" maptype. However, I get this error with the basic usage :
bbox <- c(left = 24.61, bottom = 59.37, right = 24.94, top = 59.5) get_stadiamap(bbox, zoom = 12, maptype = "stamen_watercolor") %>% ggmap()
ℹ © Stadia Maps © Stamen Design © OpenMapTiles © OpenStreetMap contributors. Error: ! Failed to evaluate glue component {filetype} Caused by error: ! object 'filetype' not found Backtrace:
- ... %>% ggmap()
- ggmap::get_stadiamap(bbox, zoom = 12, maptype = "stamen_watercolor")
- base::lapply(...)
- ggmap (local) FUN(X[[i]], ...)
- ggmap:::get_stadiamap_tile(...)
All maptypes work except the stamen_watercolor. Any help with this would be highly appreciated :)
Thanks! Coralie
Hello.
The problem comes from two sides:
get_stadiamap_tile
where there is a conditional that, when a tile is not available, generates an empty (blank) graphic, but that right now does not define an object needed to generate the warning message of that drawback.Possible (temporary) solutions:
I have opted for the second option and so far it is working for me. Of course, in those maps where there are empty tiles, graphics like this will be generated:
You can see that in the upper right corner there are white squares (that's because there are tiles there that are not available and that ggmap covers them with a white square).
Note: If you are not very familiar with compiling R packages, you can use the fork I have made (patched and temporarily functional) and re-install ggmap from that forked version (running remotes::install_github("LuisLauM/ggmap", force = TRUE)
), but I will delete it as soon as the ggmap authors commit it and fix the problem properly.
I believe the problem lies in ggmap:::get_stamen_url
and
if (maptype %in% c("watercolor"))
should be
if (maptype %in% c("stamen_watercolor"))
Partial matching does not apply here and current version of the if-then
clause leads to wrong file extension for stamen_watercolor.
Tested and it actually fixes the issue.
Thanks to everyone, the problem is solved with @andrew-griffen's solution ! :)
Hi, I am working with get_stadiamap and I would like to have the "stamen_watercolor" maptype. However, I get this error with the basic usage :
bbox <- c(left = 24.61, bottom = 59.37, right = 24.94, top = 59.5) get_stadiamap(bbox, zoom = 12, maptype = "stamen_watercolor") %>% ggmap()
ℹ © Stadia Maps © Stamen Design © OpenMapTiles © OpenStreetMap contributors. Error: ! Failed to evaluate glue component {filetype} Caused by error: ! object 'filetype' not found Backtrace:
All maptypes work except the stamen_watercolor. Any help with this would be highly appreciated :)
Thanks! Coralie