1
0
Fork 0

Added a sanity check for bogus dem data points in original data.

This commit is contained in:
curt 1999-05-06 19:38:58 +00:00
parent e875ce407f
commit 4d5dea5a05

View file

@ -305,6 +305,7 @@ void
FGDem::read_b_record( ) { FGDem::read_b_record( ) {
string token; string token;
int i; int i;
int last;
// row / column id of this profile // row / column id of this profile
prof_row = next_int(); prof_row = next_int();
@ -331,9 +332,17 @@ FGDem::read_b_record( ) {
token = next_token(); token = next_token();
// One (usually) dimensional array (prof_num_cols,1) of elevations // One (usually) dimensional array (prof_num_cols,1) of elevations
last = 0;
for ( i = 0; i < prof_num_rows; i++ ) { for ( i = 0; i < prof_num_rows; i++ ) {
prof_data = next_int(); prof_data = next_int();
// a bit of sanity checking that is unfortunately necessary
if ( prof_data > 10000 ) { // meters
prof_data = last;
}
dem_data[cur_col][i] = (float)prof_data; dem_data[cur_col][i] = (float)prof_data;
last = prof_data;
} }
} }