mland_export_gis: Exports a 'MultiLand' object as GIS data

View source: R/mland_export_gis.R

mland_export_gisR Documentation

Exports a 'MultiLand' object as GIS data

Description

Exports points, buffers and intersections between buffers and raster layers, as vector and raster files.

Usage

mland_export_gis(
  x,
  raster = NULL,
  points = NULL,
  radii = NULL,
  ext_raster = NULL,
  name = NULL,
  gdal = c("COMPRESS=DEFLATE", "PREDICTOR=2", "ZLEVEL=9"),
  dir = NULL,
  verbose = TRUE,
  ...
)

Arguments

x

An object of class 'MultiLand' generated with mland().

raster, ext_raster

Numeric. The raster layers to be exported.

points

Numeric or character vector of points to be processed. See Details.

radii

Numeric vector of radii to be processed.

name

Character. Name of the zip file where files will be exported.

gdal

GeoTiff creation options for rasters (GeoTiff file format). mland_export_gis() uses the following compression options: c("COMPRESS=DEFLATE", "PREDICTOR=2", "ZLEVEL=9").

dir

Path to the export directory. This must be specified explicitly. To export to the current directory, use dir = getwd(). Otherwise, provide a valid path to an existing directory, ensuring it does not end with "/".

verbose

Print messages in the console? Default is TRUE.

...

Other arguments passed to terra::writeRaster.

Details

If argument points is a character vector, mland_export_gis() will assume that the 'MultiLand' object inputted in argument x was created with site_ref = TRUE. This is, there is an attribute in points layer data with the names for each individual point. Therefore, the inputted values in argument points will be taken as these identification names. Otherwise, if a numeric vector is declared, the inputted values will be taken as the automatically generated point ids (created when running mland()).

Value

GIS data from a 'MultiLand' object is exported through a zip file.

See Also

mland(), mland_save(), mland_load()

Examples


# Loads a 'MultiLand' object
ernesdesign <- system.file("extdata", "ernesdesign.zip", package = "multilandr")
ernesdesign <- mland_load(ernesdesign)

# Exports as GIS data, in temporary directory for this example and with a given name
mland_export_gis(ernesdesign, dir = tempdir(), name = "mland-GIS_example")

# Remove file for this example
unlink(file.path(tempdir(), "mland-GIS_example.zip"))


phuais/multilandR documentation built on Feb. 21, 2025, 7:52 a.m.