Closed cingularities closed 1 year ago
Hmmm... with a reproducible example, I'll have to just start troubleshooting somewhere. Does your code work with any of the provided las datasets accessed via getExampleData()?
I can't seem to get the data either.
Hmmm... with a reproducible example, I'll have to just start troubleshooting somewhere. Does your code work with any of the provided las datasets accessed via getExampleData()?
I am getting an error when trying to load the data. Error in download.file(paste0("http://quantitativeecology.org/files/spanner/", : the 'internal' method for http:// URLs is defunct
Here is a sample dataset: https://drive.google.com/file/d/1qegUHoKWwK8KA9tl6r4dI6mawxwCtrjy/view?usp=sharing
Please let me know if you can access the data, I am hoping to get this running by end of day! thank you Cindy
Try grabbing one from here.. Same link, just not an automated download. http://quantitativeecology.org/files/spanner/
Running it now and it worked with your laz file
Sent you a request to access the file you linked... had to use my gmail acct since my official nau email isn't linked to Google for faculty if you were once a student here. weird. I know.
Shared, hopefully that worked. Here is the the script from reading the points to detect trees.
MBA_xyz <- "mtb_A_utm.las"
MBA_points = readTLS(MBA_xyz)
MBA_points_classify = classify_ground(MBA_points, algorithm = csf(sloop_smooth = TRUE, class_threshold = 0.1, cloth_resolution = 0.5, rigidness = 2))
MBA_ground_points = filter_poi(MBA_points_classify, Classification == 2) plot(MBA_ground_points)
MBA_tree_points = filter_poi(MBA_points_classify, Classification != 2)
MBA_DTM = grid_terrain(MBA_ground_points, res = 0.5, algorithm = knnidw(k = 10, p = 2))
MBA_normalized_height = lidR::normalize_height(las = MBA_points_classify, algorithm = MBA_DTM)
MBA_AGL_clean = filter_poi(MBA_normalized_height, Z >= 0.1, Z <= 40) plot(MBA_AGL_clean)
MBA_CHM = rasterize_canopy(MBA_normalized_height, res = 0.5)
#########################################################
####################XYZ DATA PREP##########
gc() set_lidr_threads(8) library(spanner) ############TreeLS and spanner#### las_check(MBA_normalized_height)
MBA_myTreeLocs = spanner::get_raster_eigen_treelocs(las = MBA_AGL_clean, res = 0.05, pt_spacing = 0.0254, dens_threshold = 0.2, neigh_sizes=c(0.333, 0.166, 0.5), eigen_threshold = 0.5, grid_slice_min = 0.6666, grid_slice_max = 2.0, minimum_polygon_area = 0.025, cylinder_fit_type = "ransac", output_location = "//snow/projects/Babst_TLidar_Tree_Rings/", max_dia=0.5, SDvert = 0.25)
Sent you a request to access the file you linked... had to use my gmail acct since my official nau email isn't linked to Google for faculty if you were once a student here. weird. I know.
I ran it again without voxelizing the points and it seems to be working or you maybe updated it already! I will let you know if I run into issues. Thank you for the quick help
The file does exist but I am running into an error.
MBA_myTreeLocs = spanner::get_raster_eigen_treelocs(las = MBA_AGL_clean, res = 0.05, pt_spacing = 0.0254, dens_threshold = 0.2, neigh_sizes=c(0.333, 0.166, 0.5), eigen_threshold = 0.5, grid_slice_min = 0.6666, grid_slice_max = 2.0, minimum_polygon_area = 0.025, cylinder_fit_type = "ransac", output_location = "//snow/projects/Babst_TLidar_Tree_Rings/", max_dia=0.5, SDvert = 0.25)
Gridding verticality... (7/14)
Error: Cannot open "//snow/projects/Babst_TLidar_Tree_Rings/temp_vertical_0.6666-2_0.5threshold_res-0.05.shp"; The file doesn't seem to exist. In addition: Warning message: [writeVector] nothing to write