Retrieve spatial data from the CAFRI database.

get_cafri_data(
  data = NULL,
  product,
  crs = NULL,
  region = NULL,
  indices = NULL,
  filename = NULL,
  host = NULL,
  port = NULL,
  options = character(0),
  overwrite = TRUE,
  merge = c("TRUE", "FALSE", "buildvrt")
)

Arguments

data

An `sf` object representing the area to pull data for. Note that data is pulled for the full bounding box around `data`, not clipped to the shape.

product

The name of the data product to retrieve. See [autodog](https://github.com/cafri-labs/autodog) for a list of available Product/Nicknames.

crs

The EPSG code for the CRS of your `sf` object. Default is to assume the CAFRI standard CRS, currently the non-EPSG value 900914.

region

The name for a region to retrieve data for. Note that if `region` is supplied, `data` is ignored. See [autodog](https://github.com/cafri-labs/autodog) for a list of available region names.

indices

The file indices to retrieve data for. Note that if `indices` is supplied, both `region` and `data` are ignored.

filename

The file name to save the data to.

host

The current IP or URL for the Labrador service - intended for development purposes only.

port

The current port used for the Labrador service - intended for development purposes only.

options

Options passed to [terrainr::merge_rasters] (which will then in turn be passed to [sf::gdal_utils] and then to `gdalwarp`). Note that this may cause your download to fail if downloading large products -- it is currently recommended to not provide options when downloading CHMs.

overwrite

Will only overwrite existing path if TRUE.

merge

logical or 'buildvrt': should the tiles be merged or downloaded individually? For large downloads, merging can be slow and so FALSE or 'buildvrt is recommended, but will result in many tiles. 'buildvrt' will keep the individual tiles, but construct a virtual raster that allows users to treat the mosaic of tiles as an individual raster.

Value

`filename`, invisibly.