get-tiles-constrained {ceramic}R Documentation

Get tiles with specific constraints

Description

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

Usage

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

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

Value

A list with files downloaded in character vector, a data frame of the tile indices, the zoom level used and the extent in raster::extent form.

See Also

get_tiles

Examples

if (!is.null(get_api_key())) {
 ex <- raster::extent(146, 147, -43, -42)
 tile_infoz <- get_tiles_zoom(ex, type = "mapbox.outdoors", zoom = 1)

 tile_infod <- get_tiles_dim(ex, type = "mapbox.outdoors", dim = c(256, 256))

 tile_infob <- get_tiles_buffer(cbind(146.5, -42.5), buffer = 5000, type = "mapbox.outdoors")
}

[Package ceramic version 0.6.0 Index]