From c558bc3677c3ede517711db29b6d4739035fc71f Mon Sep 17 00:00:00 2001 From: bw4sz Date: Fri, 13 Sep 2024 10:46:30 -0700 Subject: [PATCH] add provisional tree ID --- .DS_Store | Bin 12292 -> 12292 bytes R/crop_lidar_plots.R | 5 ++++- R/segment_trees.R | 2 +- analysis/.DS_Store | Bin 14340 -> 14340 bytes 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.DS_Store b/.DS_Store index b626c58b9b3d5bbce095ad90801a0e01566edcd5..748e2d7eb8a8bf9761f43909a588aeb801c2ef37 100644 GIT binary patch delta 16 XcmZokXi3=MtT;JAQFL>J;u<~xHme2f delta 18 ZcmZokXi3=MtjNeXIZ;t$bA;j=J^(y?1?~U< diff --git a/R/crop_lidar_plots.R b/R/crop_lidar_plots.R index fe2486e..08cb752 100644 --- a/R/crop_lidar_plots.R +++ b/R/crop_lidar_plots.R @@ -77,7 +77,10 @@ crop_lidar_plots<-function(site_name="TEAK",year="2018"){ #if null, return NA if(nrow(clipped_las@data)==0){ next - } + } + + # add predicted treeid from segment_trees + clipped_las<-lidR::segment_trees(las, lidR::li2012(dt1 = 1,dt2=2,hmin=2,speed_up = 10)) lidR::writeLAS(clipped_las,cname) print(cname) diff --git a/R/segment_trees.R b/R/segment_trees.R index ec57620..de00669 100644 --- a/R/segment_trees.R +++ b/R/segment_trees.R @@ -59,7 +59,7 @@ segment_trees<-function(las,algorithm="watershed",chm=chm,plots=F, max_cr_factor tree = lidR::filter_poi(crowns, !is.na(treeID)) if(plots){ - plot(tree, color = "treeID", colorPalette = pastel.colors(100), size = 1) + plot(tree, color = "treeID", pal = pastel.colors(100), size = 1) } } diff --git a/analysis/.DS_Store b/analysis/.DS_Store index d08d585a640c8e55de0ea5116f4c0e34cc56c2de..1fcdd89c17c007833a0e6d8478eaebeec63ba21b 100644 GIT binary patch delta 92 zcmZoEXepTB&*;1{pqy><5+z$k9tH*mMj!?P4(`nxrNmh_tMfb&R?z|qa5KaMVF5!W nLo!1m5N9x?f<#h^lXH^t^K%$C^C;Zl-^_0CiDmOO6>eq#0mK(Q delta 57 zcmZoEXepTB&*-!