Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stamen_watercolor doesn't work #361

Open
rssco opened this issue Apr 18, 2024 · 2 comments
Open

stamen_watercolor doesn't work #361

rssco opened this issue Apr 18, 2024 · 2 comments

Comments

@rssco
Copy link

rssco commented Apr 18, 2024

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:

  1. ... %>% ggmap()
  2. ggmap::get_stadiamap(bbox, zoom = 12, maptype = "stamen_watercolor")
  3. base::lapply(...)
  4. ggmap (local) FUN(X[[i]], ...)
  5. ggmap:::get_stadiamap_tile(...)

All maptypes work except the stamen_watercolor. Any help with this would be highly appreciated :)

Thanks!
Coralie

@andrew-griffen
Copy link

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.

@LuisLauM
Copy link

LuisLauM commented May 7, 2024

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:

  1. ... %>% ggmap()
  2. ggmap::get_stadiamap(bbox, zoom = 12, maptype = "stamen_watercolor")
  3. base::lapply(...)
  4. ggmap (local) FUN(X[[i]], ...)
  5. 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:

  • In the ggmap code itself, specifically in the internal function 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.
  • In the Stadia Maps tile availability itself. It seems to me that this unavailability may be related to the migration from Stamen to Stadia, but I'm not sure. [link]

Possible (temporary) solutions:

  • Play with the zoom argument in order to avoid areas where there are empty tiles.
  • Make a fork of the ggmap repo, patch the missing part of the code and compile the package locally.

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:

image

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.

https://github.com/LuisLauM/ggmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants