ggmap Overlay shapefile with filled polygon of regions

city = readShapePoly("/home/xuefliang/RInMedicine/city/city_region.shp") 
gpclibPermit()  #install.packages("gpclib", type = "source")
tract <- fortify(city,region="CNTY_CODE")

gansu <- get_map(location = 'gansu', zoom = 5,maptype = 'roadmap')
ggmap(gansu)+
  geom_polygon(data = tract, aes(x = long, y = lat, group = group), colour = "black",fill='grey' ,alpha = 0.2) +
  theme_nothing(legend = TRUE)+
  coord_cartesian(xlim=c(90, 110), ylim=c(32, 43))

评论

此博客中的热门博文

V2ray websocket(ws)+tls+nginx分流

Rstudio 使用代理