Added --nudge option to fgfs-construct
This commit is contained in:
parent
a8f76d3efc
commit
327d8d1139
3 changed files with 13 additions and 3 deletions
|
@ -45,6 +45,7 @@ SG_USING_STD(cout);
|
||||||
|
|
||||||
// Constructor.
|
// Constructor.
|
||||||
TGClipper::TGClipper() {
|
TGClipper::TGClipper() {
|
||||||
|
nudge=0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,7 +128,7 @@ bool TGClipper::load_polys(const string& path) {
|
||||||
} else {
|
} else {
|
||||||
startz = -9999.0;
|
startz = -9999.0;
|
||||||
}
|
}
|
||||||
p = Point3D(startx, starty, startz);
|
p = Point3D(startx+nudge, starty+nudge, startz);
|
||||||
poly.add_node( i, p );
|
poly.add_node( i, p );
|
||||||
if ( poly3d ) {
|
if ( poly3d ) {
|
||||||
fixed_elevations.unique_add( p );
|
fixed_elevations.unique_add( p );
|
||||||
|
@ -141,7 +142,7 @@ bool TGClipper::load_polys(const string& path) {
|
||||||
} else {
|
} else {
|
||||||
z = -9999.0;
|
z = -9999.0;
|
||||||
}
|
}
|
||||||
p = Point3D( x, y, z );
|
p = Point3D( x+nudge, y+nudge, z );
|
||||||
poly.add_node( i, p );
|
poly.add_node( i, p );
|
||||||
if ( poly3d ) {
|
if ( poly3d ) {
|
||||||
fixed_elevations.unique_add( p );
|
fixed_elevations.unique_add( p );
|
||||||
|
@ -161,7 +162,7 @@ bool TGClipper::load_polys(const string& path) {
|
||||||
&& (fabs(startz - lastz) < SG_EPSILON) ) {
|
&& (fabs(startz - lastz) < SG_EPSILON) ) {
|
||||||
// last point same as first, discard
|
// last point same as first, discard
|
||||||
} else {
|
} else {
|
||||||
p = Point3D( lastx, lasty, lastz );
|
p = Point3D( lastx+nudge, lasty+nudge, lastz );
|
||||||
poly.add_node( i, p );
|
poly.add_node( i, p );
|
||||||
if ( poly3d ) {
|
if ( poly3d ) {
|
||||||
fixed_elevations.unique_add( p );
|
fixed_elevations.unique_add( p );
|
||||||
|
|
|
@ -105,6 +105,8 @@ public:
|
||||||
|
|
||||||
// Return the fixed elevation points list
|
// Return the fixed elevation points list
|
||||||
inline TGTriNodes get_fixed_elevations() const { return fixed_elevations; }
|
inline TGTriNodes get_fixed_elevations() const { return fixed_elevations; }
|
||||||
|
|
||||||
|
double nudge;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ static const double half_cover_size = cover_size * 0.5;
|
||||||
// to gaps. If we put skirts around everything that might hide the
|
// to gaps. If we put skirts around everything that might hide the
|
||||||
// problem.
|
// problem.
|
||||||
static const double quarter_cover_size = cover_size * 0.25;
|
static const double quarter_cover_size = cover_size * 0.25;
|
||||||
|
|
||||||
|
double nudge=0.0;
|
||||||
|
|
||||||
|
|
||||||
// Translate USGS land cover values into TerraGear area types.
|
// Translate USGS land cover values into TerraGear area types.
|
||||||
|
@ -437,6 +439,8 @@ static int load_polys( TGConstruct& c, const TGArray &array ) {
|
||||||
string base = c.get_bucket().gen_base_path();
|
string base = c.get_bucket().gen_base_path();
|
||||||
string poly_path;
|
string poly_path;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
clipper.nudge = nudge;
|
||||||
|
|
||||||
// initialize clipper
|
// initialize clipper
|
||||||
clipper.init();
|
clipper.init();
|
||||||
|
@ -1139,6 +1143,7 @@ static void usage( const string name ) {
|
||||||
cout << " --lat=<degrees>" << endl;
|
cout << " --lat=<degrees>" << endl;
|
||||||
cout << " --xdist=<degrees>" << endl;
|
cout << " --xdist=<degrees>" << endl;
|
||||||
cout << " --ydist=<degrees>" << endl;
|
cout << " --ydist=<degrees>" << endl;
|
||||||
|
cout << " --nudge=<float>" << endl;
|
||||||
cout << " --useUKgrid" << endl;
|
cout << " --useUKgrid" << endl;
|
||||||
cout << " ] <load directory...>" << endl;
|
cout << " ] <load directory...>" << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
@ -1182,6 +1187,8 @@ int main(int argc, char **argv) {
|
||||||
xdist = atof(arg.substr(8).c_str());
|
xdist = atof(arg.substr(8).c_str());
|
||||||
} else if (arg.find("--ydist=") == 0) {
|
} else if (arg.find("--ydist=") == 0) {
|
||||||
ydist = atof(arg.substr(8).c_str());
|
ydist = atof(arg.substr(8).c_str());
|
||||||
|
} else if (arg.find("--nudge=") == 0) {
|
||||||
|
nudge = atof(arg.substr(8).c_str())*SG_EPSILON;
|
||||||
} else if (arg.find("--cover=") == 0) {
|
} else if (arg.find("--cover=") == 0) {
|
||||||
cover = arg.substr(8);
|
cover = arg.substr(8);
|
||||||
} else if (arg.find("--useUKgrid") == 0) {
|
} else if (arg.find("--useUKgrid") == 0) {
|
||||||
|
|
Loading…
Reference in a new issue