Learn R Programming

movecost (version 3.0.0)

mc_export: Export movecost results to disk

Description

Writes the spatial components of any movecost result object to disk: rasters as GeoTIFF, vector layers as GeoPackage (which, unlike the ESRI shapefiles produced by movecost <= 2.x, preserves full attribute names and supports mixed geometry without sidecar files). File names carry the cost function code as a suffix, as in movecost <= 2.x.

Usage

mc_export(x, dir = ".", prefix = NULL, overwrite = FALSE)

Value

Invisibly, a character vector with the paths of the written files.

Arguments

x

a movecost result object (any of movecost_surface, movecost_accum, movecost_paths, movecost_corridor, movecost_boundary, movecost_alloc, movecost_network, movecost_rank, movecost_comp).

dir

output directory (default: current working directory).

prefix

optional file-name prefix (default: the class-specific name).

overwrite

TRUE or FALSE (default): overwrite existing files.

Examples

Run this code
if (FALSE) {
dtm <- mc_volc()
start <- mc_volc_loc(); destin <- mc_destin_loc()
surf <- mc_surface(dtm, funct = "t", move = 8)
acc <- mc_accum(surf, start, breaks = 0.05)
mc_export(acc, dir = tempdir())
}

Run the code above in your browser using DataLab