Error in locating/segmenting trees from vegetation subset and existing " unreadable" CHM with "no matching extents" (NA values) #695
Replies: 1 comment 4 replies
-
It seems you are reporting an issue with |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a bunch of point clouds to process (~900) to build a validation dataset. I need to compute different tree-level and stand-level metrics, so start my analysis by locating and segmenting trees in each cloud with its existing CHM.
CHMs were produced upstream, only accounting for vegetated areas (based on point classification) - therefore many of them end up in having NA values (everywhere where it's not vegetation) and it may be the case all along the cloud length or width. When I try to load the existing CHM for the currently processed LAS file with
raster::raster
, the function fails as it cannot read the CHM file:Error in validityMethod(object) : invalid extent: xmin >= xmax
When I use
View(CHM)
, the TIF file shows a correct extent (withxmin < xmax
andymin < ymax
), butraster::raster
seems to fail because of NA values on the edge of the CHM, resulting in an impossible extent calculation as sub-task ofraster::raster
function.I tried to bypass this error by assigning a defined NA value (-9999) to NA values, but cannot even do that as the CHM won't load at all.
Given the number of point clouds and their size, I cannot afford a CHM recalculation on the hole cloud (regardless point cloud classification) within my last 2 weeks of contract.
I also get additional warnings regarding min and max values, but I don't think it will impact further analysis:
In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf
Please find attached my R script.
mean_diameter.txt
Beta Was this translation helpful? Give feedback.
All reactions