osm_raster: Load an Open Street Map image

View source: R/raster.R

osm_rasterR Documentation

Load an Open Street Map image

Description

Load an Open Street Map image

Usage

osm_raster(
  bbox,
  spec,
  zoom = osm_zoom_num_tiles(6),
  cache_spec = NULL,
  quiet = NA
)

Arguments

bbox

A [wk::rct()] or object with a [wk::wk_bbox()] method.

spec

An [osm_url_spec()]

zoom

A zoom level or an auto zoom specifier like [osm_zoom_num_tiles()].

cache_spec

An optional [osm_url_spec()] or character vector to be used as the cache.

quiet

Use 'TRUE' for fewer messages or 'FALSE' for more messages.

Value

A [wk::grd_rct()] whose data member is a nativeRaster.

Examples

bounds <- wk::rct(
  -7476083, 5349058,
  -6594103, 6243203,
  crs = osm_crs_native()
)

(grd <- osm_raster(bounds, osm_url_spec()))
plot(grd)


rosm documentation built on Aug. 27, 2023, 9:06 a.m.