Skip to contents

Download an RGB raster layer from IGN Web Map Tile Services (WMTS). WMTS focuses on performance and can only query pre-calculated tiles.

Usage

get_wmts(x,
         apikey = "ortho",
         layer = "ORTHOIMAGERY.ORTHOPHOTOS",
         zoom = 10L,
         crs = 2154,
         filename = tempfile(fileext = ".tif"),
         overwrite = FALSE,
         interactive = FALSE)

Arguments

x

Object of class sf or sfc. Needs to be located in France.

apikey

character; API key from get_apikeys() or directly from IGN website.

layer

character; layer name from get_layers_metadata(apikey, "wms") or directly from IGN website.

zoom

integer between 0 and 21; at low zoom levels, a small set of map tiles covers a large geographical area. In other words, the smaller the zoom level, the less precise the resolution. For conversion between zoom level and resolution see WMTS IGN Documentation

crs

numeric, character, or object of class sf or sfc. It is set to EPSG:2154 by default. See sf::st_crs() for more detail.

filename

character or NULL; filename or a open connection for writing. (ex : "test.tif" or "~/test.tif"). If NULL, layer is used as filename. Default drivers is ".tif" but all gdal drivers are supported, see details for more info.

overwrite

If TRUE, output raster is overwrite.

interactive

logical; If TRUE, interactive menu ask for apikey and layer.

Value

SpatRaster object from terra package.

Examples

if (FALSE) {
TO-DO
}