terrain_to_tif: Batch convert resulting derivatives to GeoTIFF

View source: R/translate.R

terrain_to_tifR Documentation

Batch convert resulting derivatives to GeoTIFF

Description

Assuming several derivatives have been computed, this function will map over directory of resulting terrain derivatives and translate the files into TIFF format if not yet existing. To translate a single file from SAGA to GeoTIFF format better use gdalUtils::gdal_translate().

Usage

terrain_to_tif(out_dir_to_translate, out_crs = NULL)

Arguments

out_dir_to_translate

directory containing outputs from elev_to_*(). Resulting TIFF files will be saved in this directory as well.

out_crs

CRS information is lost within SAGA processes, it is therefore the need to reset it at the end of the process. Here one can give CRS information of the original elevation file used to create the derivatives. This can be obtained with terra::crs(elev_filename). If the original elevation file does not have a CRS, then pass the corresponding CRS information as WKT, PROJ.4 or EPSG values.

Details

If the elevation file resulting from elev_to_sgrd() is present in the out_dir_to_translate, it will give a warning and will not convert the file to TIF, since the driver is corrupted. To refer to elevation data always use the original file.


loreabad6/terrain documentation built on July 6, 2023, 6:44 a.m.