xyz2tif: Read, convert and write xyz DEM/DSM Data as typically...

Description Usage Arguments Value Examples

View source: R/tb_bluedjinn.R

Description

Read xyz data, generate a GeoTiff file and optionally returns a raster* object.

Usage

1
xyz2tif(xyzFN = NULL, epsgCode = "25832", returnRaster = TRUE)

Arguments

xyzFN

ASCII tect file with xyz values

epsgCode

"25832"

returnRaster

logical. return as raster if TRUE

Value

object of class raster*

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
##- 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))

## End(Not run)

uavRst documentation built on Dec. 30, 2019, 5:06 p.m.