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.
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.
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.https://github.com/jblindsay/whitebox-tools/blob/ccca69ab9fbadd26229a62e540033541e4768fd5/whitebox-tools-app/src/tools/hydro_analysis/breach_depressions.rs#L316-L322
I see two options to fix this: