Skip to content

Commit

Permalink
ready for rlas update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Jul 4, 2024
1 parent 988529b commit a2903e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/io_readLAS.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ streamLAS.character = function(x, ofile, select = "*", filter = "", filter_wkt =
{
# Compatibility with rlas that no longer supports WKT string to filter polygons
geom = list()
if (packageVersion("rlas") > "1.7.0")
if (utils::packageVersion("rlas") >= "1.8.0")
{
if (is.character(filter_wkt) && filter_wkt[1] != "")
{
Expand Down Expand Up @@ -240,10 +240,11 @@ streamLAS.character = function(x, ofile, select = "*", filter = "", filter_wkt =
}
}

if (packageVersion("rlas") > "1.7.0")
if (utils::packageVersion("rlas") >= "1.8.0") {
data <- rlas:::stream.las(ifiles, ofile, select, filter, geom)
else
} else {
data <- rlas:::stream.las(ifiles, ofile, select, filter, filter_wkt)
}

if (is.null(data))
return(invisible())
Expand Down
5 changes: 5 additions & 0 deletions R/metrics_point.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ To get a version of the packge with this function enabled please contact us.", c
#' @export
point_metrics.LAS <- function(las, func, k, r, xyz = FALSE, filter = NULL, ...) {

if (is_disable_point_metrics())
{
C_point_metrics = function(a, b, c, d, e, f) {}
}

if (missing(k) && missing(r)) stop("'k' or 'r' is missing", call. = FALSE)

# knn + radius
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/setup-testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ options(rgl.useNULL = TRUE)
cat("Tests using raster:", getOption("lidR.raster.default"), "\n")
cat("Tests using future:", lidR:::engine_use_future(), "\n")
cat("Tests using OpenMP thread:", get_lidr_threads(), "\n")
cat("Tests using rlas:", as.character(packageVersion("rlas")), "\n")
#Sys.setenv(NOT_CRAN = "false")

megaplot_laz_path <- system.file("extdata", "Megaplot.laz", package="lidR")
Expand Down

0 comments on commit a2903e6

Please sign in to comment.