Get map tiles based on a Spatial*DataFrame extent. Maps can be fetched from various open map servers.
getTiles(spdf, type = "osm", zoom = NULL, crop = FALSE)
A RatserBrick is returned.
Zoom levels are descibed on the OpenStreetMap wiki: http://wiki.openstreetmap.org/wiki/Zoom_levels.
This function is a wrapper around the osm.raster
function
from the rosm
package.
Use directly the http://cran.r-project.org/package=rosm package to have a finer control over
extraction and display parameters.
## Not run: ------------------------------------ # data("nuts2006") # # extract Denmark # spdf <- nuts0.spdf[nuts0.spdf$id=="DK",] # # Download the tiles, extent = Denmark # den <- getTiles(spdf = spdf, type = "osm", crop = TRUE) # class(den) # # Plot the tiles # tilesLayer(den) # # Plot countries # plot(spdf, add=TRUE) # # Map tiles sources # mtext(text = "Map data © OpenStreetMap contributors, under CC BY SA.", # side = 1, adj = 0, cex = 0.7, font = 3) ## ---------------------------------------------