From d0f17a2cd70b8652f89e026596b292da5b3dbe5e Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 16 Aug 2003 16:28:55 +0000 Subject: [PATCH] Fix for properly handling SRTM voids ... terrafit.py rescales the data range so that all the values are positive this make things a little trickier inside terra. --- src/Prep/Terra/GreedyInsert.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Prep/Terra/GreedyInsert.cc b/src/Prep/Terra/GreedyInsert.cc index 34988b51..49b16725 100644 --- a/src/Prep/Terra/GreedyInsert.cc +++ b/src/Prep/Terra/GreedyInsert.cc @@ -21,15 +21,26 @@ GreedySubdivision::GreedySubdivision(Map *map) int w = H->width; int h = H->height; + real range = H->max - H->min; is_used.init(w, h); int x,y; for(x=0;xeval(x,y) > 10 ) { + if ( range < 30000 ) { is_used(x,y) = DATA_POINT_UNUSED; } else { - is_used(x,y) = DATA_VALUE_UNKNOWN; + // data includes SRTM void's + // cout << "marking " << x << "," << y << " = " + // << map->eval(x,y) << " as "; + if ( map->eval(x,y) > (H->min + 1) ) { + is_used(x,y) = DATA_POINT_UNUSED; + // cout << "UNUSED"; + } else { + is_used(x,y) = DATA_VALUE_UNKNOWN; + // cout << "UNKNOWN"; + } + // cout << endl; } }