GADMTools (version 3.8-1)

gadm_getBackground: Gets tiles with 'rosm' from OpenStreetMap

Description

Load tiles from OpenStreetMap create and save a .tif file with assembled tiles. The bounding box is automatically retrieved from the GADM shapefile passed as argument. The .tif file is stored in the working directory.

Usage

gadm_getBackground(x, name, type="osm", clip=TRUE)

gadm.getBackground(x, name, type="osm", clip=TRUE) # deprecated

Arguments

x

Object gadm_sf or gadm_sp (region that you want to add a background).

name

character the name of the TIFF file generated by this function. The .tif extension is automaticaly added.

type

Character type (default "osm') of the map provided by osm.types().

clip

boolean if TRUE (the default), background is clipped by the the external border of the spatial object. If FALSE, spatial object is drawn upper the background using the full bounding box.

Value

Object As input, gadm_sf or gadm_sp

See Also

osm.types

Examples

Run this code
# NOT RUN {
# library(GADMTools)
# library(rosm)
# FRA = gadm_loadCountries("FRA", 2, basefile = "./")
# BRE = GADMTools::subset(FRA, level=1, regions=c("Bretagne"))
# BRE2 <- gadm_getBackground(BRE, "BRE", "osm")
# plotmap(BRE2, title = "Map of Bretagne (FRANCE)")
# }

Run the code above in your browser using DataCamp Workspace