Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various filling tools: output datatype depends on flat_increment/small_num #185

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jfbourdon
Copy link
Contributor

@jfbourdon jfbourdon commented Aug 24, 2021

Contrary to what the tool documentation was saying, the output raster was always Float32 instead of Float64 causing an issue if the flat increment value was determined by the tool, but too small for Float32. Would prevent issues like #106.

Now, the output datatype is set to Float64 if the user doesn't provide any flat increment value. However, if the user provides a value, the output datatype will be the same as the input assuming that user knows what he is doing.

@jfbourdon
Copy link
Contributor Author

I also made similar changes to BreachDepressions.

@jfbourdon
Copy link
Contributor Author

Other similar changes in FillDepressions, FillDepressionsWangAndLiu and FillDepressionsPlanchonAndDarboux.
Output DEM in FillBurn is now always promoted to Float64 because the small increment is always calculated and may often be too small for Float32.

Small question, why in FillDepressionsPlanchonAndDarboux the output nodata value is always set to -32768 instead of keeping the original one?

let nodata_output = -32768.0f64;
let large_value = f64::INFINITY;
let mut output = Raster::initialize_using_file(&output_file, &input);
output.configs.data_type = DataType::F64;
output.configs.nodata = nodata_output;

@jfbourdon jfbourdon changed the title breach_depressions_LC: output datatype depends on flat_increment various filling tools: output datatype depends on flat_increment/small_num Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant