You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somes hydrology tools automatically evaluate an appropriate flat increment value based on the maximal value stored in the input DEM (see BreachDepressionsLeastCost, BreachDepressions, FillBurn, FillDepressionsPlanchonAndDardoux, FillDepressionsWandAndLiu, FillDepressions, FlowAccumFullWorkflow, UpslopeDepressionStorage). The issue is that this statistic isn't calculate at readout for all file formats but only for Surfer 7, Surfer ASCII, Idrisi, ESRI BIL, Arc Binary and Whitebox (so missing for GeoTiff, Arc ASCII, GRASS and SAGA).
This means that for the later formats, a line like (input.configs.maximum as i32).to_string().len() will output 11 and thus generate a flat increment value of 200 (for a 1 unit cell size) instead of a much smaller and appropriate value.
let small_num = if !flat_increment.is_nan() || flat_increment == 0f64{
flat_increment
}else{
let elev_digits = (input.configs.maximumasi64).to_string().len();
let elev_multiplier = 10.0_f64.powi((6 - elev_digits)asi32);
1.0_f64 / elev_multiplier asf64* diagres.ceil()
};
I see two options to fix this:
In each of the aforementioned tools, compute the maximal value instead of relying on what is stored inside the raster config object.
Make computing (and ideally not reading from metadata) min/max statistics for all raster formats. This option has a higher cost, but as other tools might also need those statistics, it avoids having to add lines of code to multiple tools and ensure an application wide fix.
The text was updated successfully, but these errors were encountered:
Somes hydrology tools automatically evaluate an appropriate flat increment value based on the maximal value stored in the input DEM (see
BreachDepressionsLeastCost
,BreachDepressions
,FillBurn
,FillDepressionsPlanchonAndDardoux
,FillDepressionsWandAndLiu
,FillDepressions
,FlowAccumFullWorkflow
,UpslopeDepressionStorage
). The issue is that this statistic isn't calculate at readout for all file formats but only for Surfer 7, Surfer ASCII, Idrisi, ESRI BIL, Arc Binary and Whitebox (so missing for GeoTiff, Arc ASCII, GRASS and SAGA).This means that for the later formats, a line like
(input.configs.maximum as i32).to_string().len()
will output11
and thus generate a flat increment value of200
(for a 1 unit cell size) instead of a much smaller and appropriate value.whitebox-tools/whitebox-tools-app/src/tools/hydro_analysis/breach_depressions.rs
Lines 316 to 322 in ccca69a
I see two options to fix this:
The text was updated successfully, but these errors were encountered: