View source: R/UtilityFunctions.R
readDTM | R Documentation |
readDTM
reads surface and raster data stored in FUSION's DTM format and returns information related
to the DTM.
readDTM(
fileName = NULL,
type = "matrix",
epsg = NULL,
crs = NULL,
negativeToNA = TRUE
)
fileName |
character (required): Name of the DTM format file containing data to be read. |
type |
character: Desired return type: "matrix" for data values in a matrix, "terra" for SpatRaster object compatible with the terra package, "raster" for a RasterLayer object compatible with the raster package, and "header" to return the DTM file header as a data frame. |
epsg |
numeric: EPSG code defining the projection for the data. This is assigned to the
SpatRaster object when |
crs |
character: PROJ.4 type description of a Coordinate Reference System (map projection).
You can only specify one of |
negativeToNA |
boolean: Replace negative values with NA (TRUE) or leave negative values as
is (FALSE). Setting this
to FALSE to preserve negative values can lead to erroneous values for the minimum value when writing the
data to a new DTM using |
When type = "matrix"
(default), the return is a matrix containing the values. Matrix element
[1,1] is the value in upper left corner.
When type = "terra"
, the return is a SpatRaster object compatible with the terra package.
When type = "raster"
, the return is a RasterLayer object compatible with the raster package.
Return value depends on type
. If type = "matrix"
, return value is a
(invisible) matrix containing the values. If type = "terra"
, return value is a
(invisible) SpatRaster object compatible with the terra package. If type =
"raster"
, return value is a (invisible) RasterLayer object compatible with the raster
package. If type = "header"
, return type is a data frame with the header parameters.
Other helpers:
readLDA()
,
writeDTM()
## Not run:
df <- readDTM("surface.dtm")
dtm <- readLDA("surface.dtm", type = "raster", epsg = 26910)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.