1
0
Fork 0

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.
This commit is contained in:
curt 2003-03-19 22:51:26 +00:00
parent 869f0412a3
commit bab9af52b3

View file

@ -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 );