Get tiles by zoom, by overall dimension, or by buffer on a single point.

get_tiles_zoom(x, zoom = 0, ..., format = "png")

get_tiles_dim(x, dim = c(512, 512), ..., format = "png")

get_tiles_buffer(x, buffer = NULL, ..., max_tiles = 9, format = "png")

Arguments

x

a spatial object with an extent

zoom

desired zoom for tiles, use with caution - cannot be unset in get_tiles_zoom

...

passed to get_tiles()

format

defaults to "png", also available is "jpg"

dim

for get_tiles_dim the overall maximum dimensions of the image (padded out to tile size of 256x256)

buffer

width in metres to extend around the location, ignored if 'x' is a spatial object with extent

max_tiles

maximum number of tiles - if NULL is set by zoom constraints

Value

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.

Details

Each function expects an extent in longitude latitude or a spatial object with extent as the first argument.

get_tiles_zoom() requires a zoom value, defaulting to 0

get_tiles_dim() requires a dim value, default to c(512, 512), a set of 4 tiles

get_tiles_buffer() requires a single location (longitude, latitude) and a buffer in metres

See also

get_tiles

Examples

if (!is.null(get_api_key())) {
 ex <- ext(146, 147, -43, -42)
 tile_infoz <- get_tiles_zoom(ex,  zoom = 1)

 tile_infod <- get_tiles_dim(ex,  dim = c(256, 256))

 tile_infob <- get_tiles_buffer(cbind(146.5, -42.5), buffer = 5000)
}
#> Warning: no mapbox key found
#> 
#> To set your Mapbox API key obtain a key from https://account.mapbox.com/access-tokens/
#> 
#> 1) Run this to set for the session 'Sys.setenv(MAPBOX_API_KEY=<yourkey>)'
#> 
#> OR,
#> 
#> 2) To set permanently store 'MAPBOX_API_KEY=<yourkey>' in ~/.Renviron
#> 
#> See 'help(ceramic::get_api_key)'