From bab9af52b32b7e476c187e7ef9e7dcb5f34b1bd1 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 19 Mar 2003 22:51:26 +0000 Subject: [PATCH] Just ignore "void" data points when doing the surface fit. I think this is probably better than guessing at a value and fitting to the guessed value. For corner points (where we *need* a value to do the fit) use the elevation of the "closest" euclidean-wise valid point. --- src/Prep/ArrayFit/arrayfit.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Prep/ArrayFit/arrayfit.cxx b/src/Prep/ArrayFit/arrayfit.cxx index 23e1955a..f7b70eb4 100644 --- a/src/Prep/ArrayFit/arrayfit.cxx +++ b/src/Prep/ArrayFit/arrayfit.cxx @@ -182,7 +182,13 @@ int main( int argc, char **argv ) { x = basex + i * dx; y = basey + j * dy; z = a.get_array_elev( i, j ); - pending.push_back( Point3D(x, y, z) ); + if ( z > -9000 ) { + pending.push_back( Point3D(x, y, z) ); + } else { + // just ignore voids, better just not include + // them, rather than making a stupid guess at a + // value + } } } } @@ -197,7 +203,7 @@ int main( int argc, char **argv ) { // Make the corner vertices (enclosing exactly the DEM coverage area) x = basex; y = basey; - z = a.interpolate_altitude( x, y ); + z = a.altitude_from_grid( x, y ); cout << "adding = " << Point3D( x, y, z) << endl; add_point( fitted, Point3D( x, y, z) ); errors.push_back( 13000.0 ); @@ -205,7 +211,7 @@ int main( int argc, char **argv ) { x = basex + dx * (a.get_cols() - 1); y = basey; - z = a.interpolate_altitude( x, y ); + z = a.altitude_from_grid( x, y ); cout << "adding = " << Point3D( x, y, z) << endl; add_point( fitted, Point3D( x, y, z) ); errors.push_back( 13000.0 ); @@ -213,7 +219,7 @@ int main( int argc, char **argv ) { x = basex + dx * (a.get_cols() - 1); y = basey + dy * (a.get_rows() - 1); - z = a.interpolate_altitude( x, y ); + z = a.altitude_from_grid( x, y ); cout << "adding = " << Point3D( x, y, z) << endl; add_point( fitted, Point3D( x, y, z) ); errors.push_back( 13000.0 ); @@ -221,7 +227,7 @@ int main( int argc, char **argv ) { x = basex; y = basey + dy * (a.get_rows() - 1); - z = a.interpolate_altitude( x, y ); + z = a.altitude_from_grid( x, y ); cout << "adding = " << Point3D( x, y, z) << endl; add_point( fitted, Point3D( x, y, z) ); errors.push_back( 13000.0 );