l4_convert | R Documentation |
sf
object and export itWrite GEDI level 4A data to disk as a vector file.
l4_convert(gediL4, epsg = NULL, filename, return_path = F, ...)
gediL4 |
|
epsg |
Numeric: destination EPSG code. Default to NULL. |
filename |
Character: path to data source name. Usually a file name with
extension. See |
return_path |
Logical: if TRUE, the path of the saved file will be returned, otherwise the function will return NULL. Default to FALSE. |
... |
Others argument to pass to |
If a file extension will cause conflict with the filetype, the extension will be guessed from the file name. Note that in converting data to ESRI Shapefile, columns names will be abbreviated.
The function is called for its side effects. It return NULL
unless return_path=TRUE
.
writeVector
outdir = tempdir()
l4_zip <- system.file("extdata",
"GEDI04_A_2020036151358_O06515_02_T00198_02_002_01_V002.zip",
package="GEDI4R")
l4 <- unzip(l4_zip,exdir = outdir)
#get GEDI data
l4_data <- l4_getmulti(l4)
#convert to shp file
converted <- l4_convert(l4_data,epsg = 4326,filename=paste0(outdir,"/example.shp"),return_path = T)
example <- terra::vect(converted)
file.remove(list.files(outdir,pattern = "example",full.names = T))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.