Skip to content

Commit

Permalink
Fix for #86
Browse files Browse the repository at this point in the history
  • Loading branch information
jblindsay committed Jun 7, 2020
1 parent 10b1ac6 commit 6777780
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl WhiteboxTool for RasterStreamsToVector {
// add the attributes
output
.attributes
.add_field(&AttributeField::new("FID", FieldDataType::Int, 5u8, 0u8));
.add_field(&AttributeField::new("FID", FieldDataType::Int, 7u8, 0u8));
output.attributes.add_field(&AttributeField::new(
"STRM_VAL",
FieldDataType::Real,
Expand Down
22 changes: 20 additions & 2 deletions src/tools/terrain_analysis/wetness_index.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. John Lindsay
Created: July 2, 2017
Last Modified: January 21, 2018
Created: 02/07/2017
Last Modified: 21/01/2018
License: MIT
*/

Expand All @@ -17,6 +17,24 @@ use std::sync::mpsc;
use std::sync::Arc;
use std::thread;

/// This tool can be used to calculate the topographic wetness index, commonly used in the TOPMODEL rainfall-runoff framework.
/// The index describes the propensity for a site to be saturated to the surface given its contributing area and local slope
/// characteristics. It is calculated as:
///
/// > WI = Ln(As / tan(Slope))
///
/// Where `As` is the specific catchment area (i.e. the upslope contributing area per unit contour length) estimated using one of
/// the available flow accumulation algorithms in the Hydrological Analysis toolbox. Notice that `As` must not be log-transformed
/// prior to being used; log-transformation of `As` is a common practice when visualizing the data. The slope image should be
/// measured in degrees and can be created from the base digital elevation model (DEM) using the `Slope` tool. Grid cells with a
/// slope of zero will be assigned **NoData** in the output image to compensate for the fact that division by zero is infinity.
/// These very flat sites likely coincide with the wettest parts of the landscape. The input images must have the same grid dimensions.
///
/// Grid cells possessing the NoData value in either of the input images are assigned NoData value in the output image. The output
/// raster is of the float data type and continuous data scale.
///
/// See Also
/// `Slope`, `D8FlowAccumulation`, `DInfFlowAccumulation`, `Fd8FlowAccumulation`, `BreachDepressionsLeastCost`
pub struct WetnessIndex {
name: String,
description: String,
Expand Down

0 comments on commit 6777780

Please sign in to comment.