R/tb_bluedjinn.R
xyz2tif.Rd
Read xyz data, generate a GeoTiff file and optionally returns a raster* object.
xyz2tif(xyzFN = NULL, epsgCode = "25832", returnRaster = TRUE)
ASCII tect file with xyz values
"25832"
logical. return as raster if TRUE
object of class raster*
if (FALSE) {
##- libraries
require(uavRst)
setwd(tempdir())
##- get typical xyz DEM data in this case from the Bavarian authority
utils::download.file("http://www.ldbv.bayern.de/file/zip/10430/DGM_1_ascii.zip",
"testdata.zip")
file<- unzip("testdata.zip",list = TRUE)$Name[2]
unzip("testdata.zip",files = file, overwrite = TRUE)
##- show structure
head(read.table(file))
##- create tiff file
##- NOTE for creating a geotiff you have to provide the correct EPSG code from the meta data
xyz2tif(file,epsgCode = "31468")
##- visualize it
raster::plot(raster::raster(file))
}