Skip to content

Commit

Permalink
output paths update
Browse files Browse the repository at this point in the history
  • Loading branch information
markusmnzngr committed Mar 2, 2023
1 parent 16f4802 commit b0103f3
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ if (!requireNamespace("imager", quietly = TRUE))
install.packages("imager")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("EBImage")
if (!require("EBImage", quietly = TRUE))
BiocManager::install("EBImage")
if (!requireNamespace("terra", quietly = TRUE))
install.packages("terra")
if (!requireNamespace("ForestTools", quietly = TRUE))
Expand Down Expand Up @@ -285,7 +286,7 @@ ws_segments_cleaned <- terra::subset(ws_segments_cleaned, ws_segments_cleaned$t
ndsm_grid <- terra::mask(ndsm_grid, ws_segments_cleaned, inverse=FALSE, updatevalue=NA, touches=FALSE)
# store as raster GeoTIFF
ndsm_grid_out_path <- here::here("results/urban_forest_classification", paste0("chm_grid.tif"))
ndsm_grid_out_path <- here::here("results/urban_forest_classification", "chm_grid.tif")
terra::writeRaster(ndsm_grid, ndsm_grid_out_path, overwrite = TRUE)
# merge CHM to point cloud
Expand All @@ -295,7 +296,7 @@ lidar_surface_points <- lidR::merge_spatial(lidar_surface_points, ndsm_grid, att
lidar_surface_points <- lidR::filter_poi(lidar_surface_points, !is.na(CHM))
# store LiDAR point cloud as LAS
lidar_chm_points_out_path <- here::here("results/urban_forest_classification", "lidar_chm_points.las"))
lidar_chm_points_out_path <- here::here("results/urban_forest_classification", "lidar_chm_points.las")
lidR::writeLAS(lidar_surface_points, lidar_chm_points_out_path)
# delete intermediate data
Expand Down Expand Up @@ -478,11 +479,11 @@ tree_positions_point <- terra::merge(tree_positions_point, tree_attribs_df, by =
crowns_convex_hull_poly <- terra::merge(crowns_convex_hull_poly, tree_attribs_df, by = "treeID")
# store tree positions as geojson
tree_positions_out_path <- here::here("results/parameterized_tree_crowns",paste0("tree_positions_parameterized.geojson"))
tree_positions_out_path <- here::here("results/parameterized_tree_crowns", "tree_positions_parameterized.geojson")
terra::writeVector(tree_positions_point, tree_positions_out_path, filetype = "GeoJSON", overwrite = TRUE)
# store tree crowns as geojson
crowns_convex_hull_parameterized_out_path <- here::here("results/parameterized_tree_crowns",paste0("crowns_convex_hull_parameterized.geojson"))
crowns_convex_hull_parameterized_out_path <- here::here("results/parameterized_tree_crowns", "crowns_convex_hull_parameterized.geojson")
terra::writeVector(crowns_convex_hull_poly, crowns_convex_hull_parameterized_out_path, filetype = "GeoJSON", overwrite = TRUE)
```

Expand Down

0 comments on commit b0103f3

Please sign in to comment.