Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
plot ESRI shapefiles - Google Maps
# shapefile overlapping Google Maps
library(ggplot2)
library(ggmap)
library(rgdal)
# geographical centre of Poland
poland <- get_googlemap(c(lon=19.27, lat=52.03),
zoom = 6,
maptype = "satellite")
polandMap <- ggmap(poland)
polandMap
powiats <- readOGR(".","POL_adm2")
powiats <- spTransform(powiats, CRS("+proj=longlat +datum=WGS84"))
powiats <- fortify(powiats)
polandMap <- polandMap +
geom_polygon(aes(x = long, y = lat, group = group),
fill = 'grey',
size = .2,
color = 'red',
data = powiats,
alpha = 0)
polandMap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.