Search code examples
rdictionaryggplot2openstreetmap

Remove roads from OpenStreeMap map


Is it possible to not have roads displayed in an OpenStreetMap? For instance, using this code (see How to get map to show only desired portion):

library(maps)
library(OpenStreetMap)
mp <- openmap(c(33,-95), c(43,-73),zoom=8,'stamen-watercolor')
states_map <- map_data("state") %>% filter(lat > 33 & lat < 43 & long > -95 & long < -73)
states_map_merc <- as.data.frame(projectMercator(states_map$lat,states_map$long))
states_map_merc$group <- states_map$group
counties_map <- map_data("county") %>% filter(lat > 33 & lat < 43 & long > -95 & long < -73)
counties_map_merc <- as.data.frame(projectMercator(counties_map$lat,counties_map$long))
counties_map_merc$group <- counties_map$group
OpenStreetMap::autoplot.OpenStreetMap(mp,expand=FALSE) + 
    geom_polygon(data=states_map_merc, aes(x=x,y=y,group=group), fill="black",colour="white",alpha=0, size=.7) + 
    geom_polygon(data=counties_map_merc, aes(x=x,y=y,group=group), fill="black",colour="white",alpha=0, size=.2)

...is it possible to get rid of the roads on the map while not modifying the zoom level?

enter image description here


Solution

  • No, this doesn't seem to be possible, as it is a feature of the map type you chose (stamen-watercolor).

    If you don't want the roads displayed, you will need to choose another map type, for example:

    mp <- openmap(c(33,-95), c(43,-73), zoom=8, type = 'bing')

    Bing Map type

    Here are some examples of different map types that may be helpful for you.