plot_tiles: Plot map tiles

Description Usage Arguments Note Examples

View source: R/plot_tiles.R

Description

Plot a SpatRaster object over a map. It can be used to plot tiles.

Usage

1
plot_tiles(x, adjust = FALSE, add = FALSE, ...)

Arguments

x

a SpatRaster object.

adjust

if TRUE, plot the raster without zoom-in or zoom-out in the graphic device: add margins if the raster is smaller than the graphic device, zoom-in if the raster is larger than the graphic device.

add

whether to add the layer to an existing plot (TRUE) or not (FALSE).

...

bgalpha, interpolate, or other arguments passed to be passed to plotRGB

Note

This function is a wrapper for plotRGB from the terra package.

Examples

1
2
3
4
5
library(sf)
library(maptiles)
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
nc_osm <- get_tiles(nc, crop = TRUE)
plot_tiles(nc_osm)

maptiles documentation built on Sept. 24, 2021, 5:06 p.m.