ggmap icon indicating copy to clipboard operation
ggmap copied to clipboard

Update README re. what it looks like when Stamen has poor tile data

Open DesiQuintans opened this issue 7 years ago • 4 comments

  • ggmap_3.0.0.900
  • ggplot2_3.1.0
  • R 3.5.2

I was wondering why a map I was building would sometimes get errors in some maptypes, and return a completely blank plot (i.e. a completely white background except for points) with other map types. Eventually I found that it's because Stamen does not have good tiles for that region.

It would be good if the readme could show users what happens in these cases, and what it looks like.

I will submit a PR for this later.

dat <- 
    data.frame(
        lat = c(-17.46915, -17.46915, -17.46915, -17.46915, -17.46963,
                     -17.46963, -17.46963, -17.46963, -17.46896, -17.46896,
                     -17.46896, -17.46896, -17.470533, -17.470533, -17.470533, -17.470533,
                     -17.4703, -17.4703, -17.4703, -17.4703, -17.469583, -17.469583,
                     -17.469583, -17.469583, -17.469938, -17.469938, -17.471302,
                     -17.470467, -17.470467, -17.470467, -17.470832),
       lon = c(140.79945, 140.79945, 140.79945, 140.79945, 140.79967,
                     140.79967, 140.79967, 140.79967, 140.79927, 140.79927,
                     140.79927, 140.79927, 140.796717, 140.796717, 140.796717, 140.796717,
                     140.796683, 140.796683, 140.796683, 140.796683, 140.796367,
                     140.796367, 140.796367, 140.796367, 140.793741, 140.793741,
                     140.794474, 140.795435, 140.795435, 140.795435, 140.795601)
    )

qmplot(lon, lat, data = dat, maptype = "terrain", zoom = 18)

## Using zoom = 18...
## Source : http://tile.stamen.com/terrain/18/233594/143994.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233594/143994.png.
## Source : http://tile.stamen.com/terrain/18/233595/143994.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233595/143994.png.
## Source : http://tile.stamen.com/terrain/18/233596/143994.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233596/143994.png.
## Source : http://tile.stamen.com/terrain/18/233597/143994.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233597/143994.png.
## Source : http://tile.stamen.com/terrain/18/233598/143994.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233598/143994.png.
## Source : http://tile.stamen.com/terrain/18/233599/143994.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233599/143994.png.
## Source : http://tile.stamen.com/terrain/18/233594/143995.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233594/143995.png.
## Source : http://tile.stamen.com/terrain/18/233595/143995.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233595/143995.png.
## Source : http://tile.stamen.com/terrain/18/233596/143995.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233596/143995.png.
## Source : http://tile.stamen.com/terrain/18/233597/143995.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233597/143995.png.
## Source : http://tile.stamen.com/terrain/18/233598/143995.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233598/143995.png.
## Source : http://tile.stamen.com/terrain/18/233599/143995.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233599/143995.png.
## Source : http://tile.stamen.com/terrain/18/233594/143996.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233594/143996.png.
## Source : http://tile.stamen.com/terrain/18/233595/143996.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233595/143996.png.
## Source : http://tile.stamen.com/terrain/18/233596/143996.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233596/143996.png.
## Source : http://tile.stamen.com/terrain/18/233597/143996.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233597/143996.png.
## Source : http://tile.stamen.com/terrain/18/233598/143996.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233598/143996.png.
## Source : http://tile.stamen.com/terrain/18/233599/143996.png
## Not Found (HTTP 404). Failed to aquire tile /terrain/18/233599/143996.png.

qmplot(lon, lat, data = dat, maptype = "terrain-background", zoom = 18)

## A white plot with points superimposed.

qmplot(lon, lat, data = dat, maptype = "watercolor", zoom = 18)

## A plot that shows the sea and the land

DesiQuintans avatar Feb 27 '19 00:02 DesiQuintans

Do you know if this is a by-region kind of thing? I have experienced a single missing tile inside a map several times, which lead me to believe that there was just something wrong with that tile. It is an amazingly annoying issue, because re-querying rarely helps.

dkahle avatar Mar 06 '19 14:03 dkahle

Yes, it appears to be a region-wide thing. The reason why I think this is because when I zoom into the region enough, the tiles are replaced with grey boxes in the Terrain map, but the Toner and Watercolour previews still show the underlying data. http://maps.stamen.com/#terrain/15/-17.4701/140.7978

DesiQuintans avatar Mar 06 '19 21:03 DesiQuintans

I am having this issue now for a region that previously worked

m<-matrix(c(-0.017814, 51.541923, -0.014614, 51.545123), ncol = 2, nrow = 2) bbox(m) get_map(location = m, source = "stamen", maptype = "toner-lite", color = "bw", force = TRUE)

spoonerf avatar Aug 09 '19 12:08 spoonerf

Have the same problem

loukesio avatar Feb 02 '20 22:02 loukesio