Skip to content
Snippets Groups Projects
Commit 606ae042 authored by Aurore Dupuis's avatar Aurore Dupuis
Browse files

Merge branch '65-forbid-having-zs-inferior-to-413' into 'release-1.6'

Resolve "Forbid having zs not in range [-413; 8850]"

See merge request remote_modules/let-it-snow!50
parents 6a982ab1 7215d526
No related branches found
No related tags found
4 merge requests!57Patch 1.6.4,!56Release 1.6,!55Release 1.6,!50Resolve "Forbid having zs not in range [-413; 8850]"
......@@ -299,6 +299,12 @@ short get_elev_snowline_from_bin(const itk::Statistics::ImageToHistogramFilter<i
idx4[1] = 1;
idx4[2] = 1;
// Ensure that the current elevation is in the validity range. (nodata and/or inconsistent elevation)
if ( ( histogram->GetMeasurementVector(idx1)[0] < -413 ) && (histogram->GetMeasurementVector(idx1)[0] < 8850) )
{
return -1
}
// Compute the total number of pixels on the altitude bin
const HistogramType::AbsoluteFrequencyType tot_z=histogram->GetFrequency(idx1) + histogram->GetFrequency(idx2) + histogram->GetFrequency(idx3) + histogram->GetFrequency(idx4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment