translateLAS: horizontal translation of xy locations (and vertical feet <->...

View source: R/translateLAS.R

translateLASR Documentation

horizontal translation of xy locations (and vertical feet <-> meters)

Description

horizontal translation of xy locations (and vertical feet <-> meters)

Usage

translateLAS(
  las = NA,
  las_in_path = NA,
  las_out_path = NA,
  dir_out = NA,
  out_prefix = "",
  out_suffix = "",
  out_type = c(".las", ".laz"),
  proj4from = NA,
  proj4to = NA,
  zFrom = c("ft", "m"),
  zTo = c("ft", "m"),
  zMult = c(1, 0.3048, 1/0.3048)[1],
  return = F,
  doWriteLAS = T
)

Arguments

las

(optional) las object returned by lidR::readLAS()

las_in_path

(optional) character string path to input las/laz file

las_out_path

(optional) character string path to translated las file

dir_out

(optional) character string path to directory to hold translated file

out_prefix

add prefix to file name

out_suffix

add suffix to file name before las/laz extension

out_type

character string ".las" or ".laz"

proj4from

(optional) only optional if input las/laz

proj4to

(required) character string proj4 string to translate

zMult

specify multiplier for vertical units to go e.g. from feet to meters

return

T/F return translated object?

doWriteLAS

T/F write translated object to disk

Details

horizontal translation of xy locations (and vertical feet <-> meters)

This program is free software but it is provided WITHOUT WARRANTY and with ABSOLUTELY NO GUARANTEE of fitness or functionality for any purpose; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


Revision History

1.0 5/21/2020 Created

Value

<Delete and Replace>

Author(s)

Jacob Strunk <Jacob.strunk@usda.gov>

See Also

another_function
yet_another_function

Examples



     require(sp)
     require(lidR)
     require(RSForInvt)

     if(!"las6in" %in% ls()) las6in = readLAS("D:/temp/hood_canal_test/clip6in/clipElev_FtTenthAc/clip_1.las")
     if(!"las3in" %in% ls()) las3in = readLAS("D:/temp/hood_canal_test/clip3in/clipElev_FtTenthAc/clip_1.las")
     if(!"las6in0" %in% ls()) las6in0 = readLAS("D:/data/WA/wadnr_hood_canal/laz/hood_canal_6in_DSM_2015/area1_000_000.0_6.laz")
     if(!"lasLid0" %in% ls()) lasLid0 = readLAS("D:/data/WA/wadnr_hood_canal/laz/hood_canal_lidar_2015/Hood_Canal_001.laz")

     proj4string(las6in)
     proj4string(las6in0)
     proj4string(las3in)
     proj4string(lasLid0)

     #read lidar file and past LAS object to translateLAS
     lasLid0 = readLAS("D:/data/WA/wadnr_hood_canal/laz/hood_canal_lidar_2015/Hood_Canal_001.laz")

     translateLAS(
       las = lasLid0
       ,las_in_path = NA
       ,las_out_path = "d:/temp/testtranslate/Hood_Canal_001.laz"
       ,dir_out = "d:/temp/testtranslate/"
       ,out_prefix = "rp_"
       ,out_suffix = "_utmZ10m"
       ,out_type=".laz"
       ,proj4from = NA
       ,proj4to = "+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
       ,zFrom = c("ft")
       ,zTo = c("m")
     )

     #provide path to las file
     #return las
     #don't write a new file
     lasLid0_rp = translateLAS (
       las = NA
       ,las_in_path = "D:/data/WA/wadnr_hood_canal/laz/hood_canal_lidar_2015/Hood_Canal_001.laz"
       ,las_out_path = "d:/temp/testtranslate/Hood_Canal_001.laz"
       ,dir_out = "d:/temp/testtranslate/"
       ,out_prefix = "rp_"
       ,out_suffix = "_utmZ10m"
       ,out_type=".laz"
       ,proj4from = NA
       ,proj4to = "+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
       ,zFrom = c("ft")
       ,zTo = c("m")
       ,return = T
       ,doWriteLAS = F
     )


jstrunk001/RSForInvt documentation built on April 18, 2022, 11:03 p.m.