get_tiles | R Documentation |
Obtain imagery or elevation tiles by location query. The first argument
loc
may be a spatial object (sp, raster, sf) or a 2-column matrix with a single
longitude and latitude value. Use buffer
to define a width and height to pad
around the raw longitude and latitude in metres. If loc
has an extent, then
buffer
is ignored.
read_tiles(
x,
buffer,
type = "mapbox.satellite",
crop_to_buffer = TRUE,
format = NULL,
...,
zoom = NULL,
debug = FALSE,
max_tiles = NULL,
base_url = NULL,
verbose = TRUE,
filename = ""
)
get_tiles(
x,
buffer,
type = "mapbox.satellite",
crop_to_buffer = TRUE,
format = NULL,
...,
zoom = NULL,
debug = FALSE,
max_tiles = NULL,
base_url = NULL,
verbose = TRUE
)
x |
a longitude, latitude pair of coordinates, or a spatial object |
buffer |
width in metres to extend around the location, ignored if 'x' is a spatial object with extent |
type |
character string of provider imagery type (see Details) |
crop_to_buffer |
crop to the user extent, used for creation of output objects (otherwise is padded tile extent) |
format |
tile format to use, defaults to "jpg" for Mapbox satellite imagery and "png" otherwise |
... |
arguments passed to internal function, specifically |
zoom |
desired zoom for tiles, use with caution - if |
debug |
optionally avoid actual download, but print out what would be downloaded in non-debug mode |
max_tiles |
maximum number of tiles - if |
base_url |
tile provider URL expert use only |
verbose |
report messages or suppress them |
filename |
purely for |
get_tiles()
may be run with no arguments, and will download (and report on) the default
tile source at zoom 0. Arguments type
, zoom
(or max_tiles
), format
may be used
without setting loc
or buffer
and the entire world extent will be used. Please use with caution!
There is no maximum on what will be downloaded, but it can be interrupted at any time.
Use debug = TRUE
to avoid download and simply report on what would be done.
Available types are 'elevation-tiles-prod' for AWS elevation tiles, and 'mapbox.satellite', 'mapbox.terrain-rgb'. (The RGB terrain values are not unpacked.)
Function read_tiles()
will match what get_tiles()
does and actually build a raster object.
A list with files downloaded in character vector, a data frame of the tile indices, the zoom level used and the extent in xmin,xmax,ymin,ymax form.
get_tiles_zoom get_tiles_dim get_tiles_buffer
if (!is.null(get_api_key())) {
tile_info <- get_tiles(ext(146, 147, -43, -42), type = "mapbox.satellite", zoom = 5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.