-
As the title says, I am getting a NULL error in my code below. # Read dtm for normalization
dtm <- raster("AlexSub2DTM.tif")
# Read trunks
trunks <- readOGR(dsn = "trunksfilterout2o.shp")
# read Large las as lasCatalog
las1<- readLAScatalog("Alex2swathclipped.las")
# Variables for processing
opt_output_files(las1) <- "./lasCat/laschunk_{ID}"
opt_chunk_size(las1) <- 495 # Processing chunks of 495 x 495
opt_chunk_buffer(las1) <- 15 # 15 ft buffer
opt_stop_early(las1) <- TRUE # or FALSE
opt_filter(las1) <- "-drop_z_below 15"
# Normalize
las1 <- normalize_height(las1, dtm,
na.rm = TRUE,
method = "bilinear",
overwrite = TRUE)
# CHM
opt_output_files(las1) <- "./lasCat/laschml_{ID}"
chml1 <- rasterize_canopy(las1, 0.25,
pitfree(c(0,2,5,10), c(0,1),
subcircle = 0.2),
overwrite = TRUE)
# Smoothing
ker = matrix(1,3,3)
chml1 = focal(chml1, w = ker, fun = median)
chml1 = focal(chml1, w = ker, fun = median)
# Save output
writeRaster(chml1, filename="As2_chml3_pf.tif", overwrite=TRUE)
# Tree Segmentation
algotr1 <- silva2016(chml1, trunks, exclusion = 0.5, ID = "treeID")
lastr1 <- segment_trees(las1, algotr1) This is a small subset from a much larger project so scalability is non-negotiable and clipping is the smartest way for me to reduce total file size. My las is a non-rectangular ROI clip (pit-free and no voids/holes). (zip with all data is over 1Gb and won't upload) lastr1 <- segment_trees(las1, algotr1)
#> Processing [======>-----------------------------------------------------------] 8% (1/12) eta: 2m
#> Error: NULL value passed as symbol address |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Is an Please open an issue with a minimal reproducible example. A minimal reproducible example should look like that I guess. And if it fails at the first file I guess you only need to use one LAS file to reproduce so you can share it + the rasters library(llidR)
library(terra)
library(sf)
chm1 <- rast("As2_chml3_pf.tif")
trunk <- st_read("????")
nlas <- readLAScatalog("./lasCat/")
# Tree Segmentation
algotr1 <- silva2016(chm1, trunks, exclusion = 0.5, ID = "treeID")
lastr1 <- segment_trees(nlas1, algotr1) |
Beta Was this translation helpful? Give feedback.
-
This is a "microset" of my subset (one of the 495x495 chunks from the lasCAT). The total dataset is xTB and growing. As you see it is a nonrectangular clip using a variable radius buffer around trees in close proximity to powerlines. I suspect The trunk shapefile replaces the tree top input since trunks move less across multiple collects. |
Beta Was this translation helpful? Give feedback.
-
I don't think the issue I'm seeing is the fault of lidR. Due to the size of our data I'm trying to leverage hyperthreading, but it fails with
|
Beta Was this translation helpful? Give feedback.
I don't think the issue I'm seeing is the fault of lidR. Due to the size of our data I'm trying to leverage hyperthreading, but it fails with
future
andmultisession
enabled. Without them it runs.