dkahle / ggmap

A package for plotting maps in R with ggplot2
766 stars 231 forks source link

Stamen maps still misaligned at low zooms #298

Open jdsher opened 4 years ago

jdsher commented 4 years ago

I know this has cropped up in the past, but I'm still seeing some warping of the projection below zoom 10, depending on latitude it seems.

library(tigris)
library(ggmap)
library(sf)
library(tidyverse)

counties <- counties(state = "WA", cb = TRUE)
basemap <- get_stamenmap(as.numeric(st_bbox(st_buffer(counties, .05))), z = 7, crop = TRUE, maptype = "toner-lite")

ggmap(basemap) +
  geom_sf(data = counties,
          fill = NA,
          color = "red",
          size = .25,
          inherit.aes = FALSE)

image