Skip to content

Commit

Permalink
Added the IndividualTreeDetection tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jblindsay committed Mar 5, 2023
1 parent e7fcdf3 commit 6e6b9ac
Show file tree
Hide file tree
Showing 19 changed files with 807 additions and 191 deletions.
Binary file modified .DS_Store
Binary file not shown.
41 changes: 32 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Version 2.3.0 (XX-XX-202X)
previous version of the WbRunner. It is now written in pure Rust (compared with the old Python
TkInter app) using the egui user-interface library. It has a more modern feel, is cross-platform,
and has no dependencies (including Python). You can now open multiple tools simultaneously.
- Added the IndividualTreeDetection tool for intentifying points in a LiDAR point cloud that are associated
with the tops of individual trees.
- Added the LaunchWbRunner and InstallWbExtension tools so that the Whitebox Runner will be more
accessible from other Whitebox frontends. This way users will always have a good fall-back if the
frontend is not up-to-date with the WBT backend, since WbRunner is always current with the installed
Expand All @@ -76,6 +78,7 @@ Version 2.3.0 (XX-XX-202X)
tool.
- Fixed a bugs in the HorizonAngle and ExposureTowardsWindFlux tools.
- Added a point time interpolation parameter to the LidarNearestNeighbourGridding tool.
- Added the ListUniqueValuesRaster tool.

Version 2.2.0 (23-10-2022)
- Added the TravellingSalesmanProblem tool for identifying short routes connecting multiple locations.
Expand Down
3 changes: 2 additions & 1 deletion whitebox-lidar/src/las.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2886,6 +2886,7 @@ impl LasFile {

if !self.file_name.to_lowercase().ends_with(".zip")
&& !self.file_name.to_lowercase().ends_with(".zlidar")
&& !self.file_name.to_lowercase().ends_with(".las")
{
let f = File::create(&self.file_name)?;
let mut writer = BufWriter::new(f);
Expand Down Expand Up @@ -3409,7 +3410,7 @@ impl LasFile {

// let mut reader = Reader::from_path(&input_file).expect("Error reading LAS file.");
// let in_header = reader.header();
let mut builder = Builder::from((1, 3));
let mut builder = Builder::from((1, 4));
// let mut format = in_header.point_format().clone();

let mut format = las::point::Format::new(self.header.point_format).unwrap();
Expand Down
6 changes: 6 additions & 0 deletions whitebox-lidar/src/point_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,12 @@ impl PointData {
}
}

/// Returns `true` if the point is classifed as either low, medium or high vegetation.
pub fn is_classified_vegetation(&self) -> bool {
let class = self.classification();
class == 3 || class == 4 || class == 5
}

/// Returns `true` if the point is synthetic, `false` otherwise
pub fn synthetic(&self) -> bool {
if !self.is_64bit {
Expand Down
Binary file modified whitebox-plugins/.DS_Store
Binary file not shown.
6 changes: 5 additions & 1 deletion whitebox-plugins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ path = "src/gaussian_scale_space/main.rs"
name = "heat_map"
path = "src/heat_map/main.rs"

[[bin]]
name = "individual_tree_detection"
path = "src/individual_tree_detection/main.rs"

[[bin]]
name = "install_wb_extension"
path = "src/install_wb_extension/main.rs"
Expand Down Expand Up @@ -74,7 +78,7 @@ path = "src/travelling_salesman_problem/main.rs"

[dependencies]
fasteval = "0.2.4"
kd-tree = "0.4.1"
kd-tree = { version = "0.4.1", features = ["rayon"] }
nalgebra = "0.18.0"
num_cpus = "1.13.0"
rand = { version = "0.7", features = ["small_rng"] }
Expand Down
Binary file modified whitebox-plugins/src/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"tool_name": "IndividualTreeDetection",
"exe": "individual_tree_detection",
"short_description": "Identifies points in a LiDAR point cloud that are associated with the tops of individual trees.",
"toolbox": "LiDAR Tools",
"license": "Proprietary",
"example": ">> .*EXE_NAME -r=IndividualTreeDetection -i=points.laz -o=tree_tops.shp --min_search_radius=1.5 --min_height=2.0 --max_search_radius=8.0 --max_height=30.0 --only_use_veg",
"parameters": [
{
"name": "Input LiDAR File",
"flags": ["-i", "--input"],
"description": "Name of the input LiDAR file.",
"parameter_type": {"ExistingFile":"Lidar"},
"default_value": null,
"optional": true
},
{
"name": "Output Vector",
"flags": ["-o", "--output"],
"description": "Name of the output vector points file.",
"parameter_type": {"NewFile":{"Vector":"Point"}},
"default_value": null,
"optional": true
},
{
"name": "Min. Search Radius",
"flags": ["--min_search_radius"],
"description": "Minimum search radius (m).",
"parameter_type": "Float",
"default_value": "1.0",
"optional": false
},
{
"name": "Min. Height",
"flags": ["--min_height"],
"description": "Minimum height (m).",
"parameter_type": "Float",
"default_value": "0.0",
"optional": false
},
{
"name": "Max. Search Radius",
"flags": ["--max_search_radius"],
"description": "Maximum search radius (m).",
"parameter_type": "Float",
"default_value": "",
"optional": true
},
{
"name": "Max. Height",
"flags": ["--max_height"],
"description": "Maximum height (m).",
"parameter_type": "Float",
"default_value": "",
"optional": true
},
{
"name": "Only use veg. class points?",
"flags": ["--only_use_veg"],
"description": "Only use veg. class points?",
"parameter_type": "Boolean",
"default_value": "false",
"optional": true
}
]
}
Loading

0 comments on commit 6e6b9ac

Please sign in to comment.