Error in "crown_metrics" #700
-
Hi, I segmented individual trees using "segment_trees" and "crown_metrics". As I mentioned before, I found that some las files were omitted and were not created as shapefiles. I ran the same code using a small amount of files that were omitted and it gave me an error. I used lidR version 4.0.3. las_cat<-readLAScatalog("D:/Lidar_2022/R/segment tree/missing_silva/folder1")
chm<-rasterize_canopy(las_cat, 0.5, pitfree(c(0,2,5,10,15), c(3,1.5), subcircle = 0.2))
f = tempfile(fileext = ".tif")
terra::writeRaster(chm, f)
chm = terra::rast(f)
ttops <- locate_trees(las_cat, lmf(5), uniqueness = "bitmerge")
opt_output_files(las_cat) <- "D:/Lidar_2022/R/segment tree/missing_silva/folder1/f1segmented_{XLEFT}_{YBOTTOM}"
algo <- silva2016(chm, ttops)
ctg_segmented <- segment_trees(las_cat, algo)
#WARNING: extended variable length records contain more than one WKT OGC COORDINATE SYSTEM
#WARNING: extended variable length records contain more than one WKT OGC COORDINATE SYSTEM
#Processing [===============================================================] 100% (2/2) eta: 0s
#Warning messages:
#1: There are 304 points flagged 'withheld'.
#2: There are 1132 points flagged 'withheld'.
opt_output_files(ctg_segmented) <- "D:/Lidar_2022/R/segment tree/missing_silva/folder1/f1canpoy_{XLEFT}_{YBOTTOM}"
crown_metrics(ctg_segmented, NULL, geom = "convex")
#Error: scan() expected 'a real', got 'IllegalArgumentException:'
#In addition: Warning messages:
#1: There are 304 points flagged 'withheld'.
#2: 1 invalid polygons created. They likely correspond to trees with aligned points. Is it related to the warning "extended variable length records contain more than one WKT OGC COORDINATE SYSTEM"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I guess you can reproduce with only the first file of
100% sure not. |
Beta Was this translation helpful? Give feedback.
I strongly think not but who knows... Bugs might be nasty.
So, please reproduce your bug with the very minimal amount of data and the very minimal amount of code you can. Open an issue (not a discussion otherwise i'll forget it) and share your data. Try with a single file catalog, if it works, try with two files and so on. Thanks