@@ -53,17 +53,19 @@ Just some basic examples for package usage.
5353``` r
5454library(managelidar )
5555
56+ # create various valid input paths
5657folder <- system.file(" extdata" , package = " managelidar" )
5758las_files <- list.files(folder , full.names = T , pattern = " *.laz" )
58- las_file <- las_files [1 ]
59- vpc_file <- tempfile(fileext = " .vpc" ); lasR :: exec(lasR :: write_vpc(vpc_file , absolute_path = TRUE ), on = las_files )
60- # > [1] "C:\\Users\\JWIESE~1\\AppData\\Local\\Temp\\RtmpWm4m4p\\file13f832ae6ba3.vpc"
59+ las_file <- las_files [1 ]
60+ vpc_file <- tempfile(fileext = " .vpc" )
61+ lasR :: exec(lasR :: write_vpc(vpc_file , absolute_path = TRUE ), on = las_files )
62+ # > [1] "C:\\Users\\JWIESE~1\\AppData\\Local\\Temp\\RtmpghBJtg\\file16ffcbda271a.vpc"
6163vpc_obj <- yyjsonr :: read_json_file(vpc_file )
6264mixed <- c(folder , las_file )
6365
64- paths <- list (folder , las_files , las_file , vpc_file , vpc_obj , mixed )
66+ paths <- list (folder , las_files , las_file , vpc_file , vpc_obj , mixed )
6567
66- # get the Coordinate reference system for all types of input
68+ # get the Coordinate Reference System for all types of input
6769lapply(paths , get_crs )
6870# > [[1]]
6971# > filename crs
@@ -111,4 +113,17 @@ get_extent(las_files)
111113# > 2 3dm_32_547_5725_1_ni_20240327.laz 547648 5725000 547998.1 5725991
112114# > 3 3dm_32_548_5724_1_ni_20240327.laz 548000 5724000 548992.0 5724997
113115# > 4 3dm_32_548_5725_1_ni_20240327.laz 548000 5725000 548995.4 5725992
116+
117+ # get names of files intersecting an extent
118+ las_files | >
119+ filter_spatial(c(547900 , 5724900 , 548100 , 5724900 )) | >
120+ get_names()
121+ # > [1] "3dm_32_547_5724_1_ni_20240327.laz" "3dm_32_548_5724_1_ni_20240327.laz"
122+
123+ # combine with temporal filter
124+ las_files | >
125+ filter_temporal(" 2024-03" ) | >
126+ filter_spatial(c(547900 , 5724900 , 548100 , 5724900 )) | >
127+ get_names()
128+ # > [1] "3dm_32_547_5724_1_ni_20240327.laz" "3dm_32_548_5724_1_ni_20240327.laz"
114129```
0 commit comments