1
0
Fork 0

Check point ...

This commit is contained in:
curt 2003-03-14 01:51:18 +00:00
parent d05fd4a8ff
commit aa37052182
6 changed files with 59 additions and 13 deletions

View file

@ -500,8 +500,8 @@ void build_airport( string airport_raw, float alt_m,
string type_flag = runways[i].surface_flags.substr(2, 1);
if ( type_flag == "P" ) {
build_runway( runways[i], elev * SG_FEET_TO_METER,
&rwy_polys, &texparams, &accum, &apt_base,
&apt_clearing );
&rwy_polys, &texparams, &accum,
&apt_base, &apt_clearing );
}
}
@ -510,8 +510,8 @@ void build_airport( string airport_raw, float alt_m,
string type_flag = runways[i].surface_flags.substr(2, 1);
if ( type_flag == "R" || type_flag == "V" ) {
build_runway( runways[i], elev * SG_FEET_TO_METER,
&rwy_polys, &texparams, &accum, &apt_base,
&apt_clearing );
&rwy_polys, &texparams, &accum,
&apt_base, &apt_clearing );
}
}
@ -521,8 +521,8 @@ void build_airport( string airport_raw, float alt_m,
if ( type_flag != string("P") && type_flag != string("R")
&& type_flag != string("V") ) {
build_runway( runways[i], elev * SG_FEET_TO_METER,
&rwy_polys, &texparams, &accum, &apt_base,
&apt_clearing );
&rwy_polys, &texparams, &accum,
&apt_base, &apt_clearing );
}
}
@ -929,6 +929,8 @@ void build_airport( string airport_raw, float alt_m,
point_list geod_nodes = calc_elevations( apt_surf, nodes.get_node_list(),
0.0 );
divided_base = calc_elevations( apt_surf, divided_base, 0.0 );
cout << "DIVIDED" << endl;
cout << divided_base << endl;
SG_LOG(SG_GENERAL, SG_DEBUG, "Done with base calc_elevations()");

View file

@ -129,7 +129,9 @@ bool TGClipper::load_polys(const string& path) {
}
p = Point3D(startx, starty, startz);
poly.add_node( i, p );
if ( poly3d ) {
fixed_elevations.unique_add( p );
}
for ( j = 1; j < count - 1; ++j ) {
in >> x;
@ -141,8 +143,10 @@ bool TGClipper::load_polys(const string& path) {
}
p = Point3D( x, y, z );
poly.add_node( i, p );
if ( poly3d ) {
fixed_elevations.unique_add( p );
}
}
in >> lastx;
in >> lasty;
@ -159,9 +163,11 @@ bool TGClipper::load_polys(const string& path) {
} else {
p = Point3D( lastx, lasty, lastz );
poly.add_node( i, p );
if ( poly3d ) {
fixed_elevations.unique_add( p );
}
}
}
in >> skipcomment;
}

View file

@ -0,0 +1,17 @@
Sample command line to build a specific tile-id:
./fgfs-construct --min-angle=10 --work-dir=/stage/fgfs04/curt/Work --output-dir=/stage/fgfs04/curt/FlightGear --tile-id=942050 /stage/fgfs04/curt/Work/AirportArea /stage/fgfs04/curt/Work/AirportObj /stage/fgfs04/curt/Work/GSHHS-Ponds /stage/fgfs04/curt/Work/GSHHS-Islands /stage/fgfs04/curt/Work/GSHHS-Lakes /stage/fgfs04/curt/Work/GSHHS-LandMass /stage/fgfs04/curt/Work/USA-Hydro /stage/fgfs04/curt/Work/USA-Urban /stage/fgfs04/curt/Work/SRTM-1 2>&1 | less
Sample command line to build tiles intersecting an area specified by a
point and a lat/lon distance (in degrees.)
./fgfs-construct --min-angle=0 --work-dir=/stage/fgfs04/curt/Work --output-dir=/stage/fgfs04/curt/FlightGear --lon=-122.374843 --lat=37.619002 --xdist=0.5 --ydist=0.5 --cover=/stage/fgfs04/curt/Work/LC-Global/gusgs2_0ll.img.old /stage/fgfs04/curt/Work/AirportArea /stage/fgfs04/curt/Work/AirportObj /stage/fgfs04/curt/Work/GSHHS-Ponds /stage/fgfs04/curt/Work/GSHHS-Islands /stage/fgfs04/curt/Work/GSHHS-Lakes /stage/fgfs04/curt/Work/GSHHS-LandMass /stage/fgfs04/curt/Work/USA-Hydro /stage/fgfs04/curt/Work/USA-Urban /stage/fgfs04/curt/Work/SRTM-1
Sample command line with standard airports:
./fgfs-construct --output-dir=. --work-dir=/stage/fgfs01/curt/Work --cover=/stage/fgfs01/curt/Work/LC-Global/gusgs2_0ll.img --tile-id=958424 /stage/fgfs01/curt/Work/AirportArea /stage/fgfs01/curt/Work/AirportObj /stage/fgfs01/curt/Work/GSHHS-Ponds /stage/fgfs01/curt/Work/GSHHS-Islands /stage/fgfs01/curt/Work/GSHHS-Lakes /stage/fgfs01/curt/Work/GSHHS-LandMass /stage/fgfs01/curt/Work/USA-Hydro /stage/fgfs01/curt/Work/USA-Urban /stage/fgfs01/curt/Work/DEM-3 /stage/fgfs01/curt/Work/DEM-30
Similar command line but using Photo airports:
./fgfs-construct --output-dir=. --work-dir=/stage/fgfs01/curt/Work --cover=/stage/fgfs01/curt/Work/LC-Global/gusgs2_0ll.img --tile-id=958424 /stage/fgfs01/curt/Work/PhotoArea /stage/fgfs01/curt/Work/PhotoObj /stage/fgfs01/curt/Work/GSHHS-Ponds /stage/fgfs01/curt/Work/GSHHS-Islands /stage/fgfs01/curt/Work/GSHHS-Lakes /stage/fgfs01/curt/Work/GSHHS-LandMass /stage/fgfs01/curt/Work/USA-Hydro /stage/fgfs01/curt/Work/USA-Urban /stage/fgfs01/curt/Work/DEM-3 /stage/fgfs01/curt/Work/DEM-30

View file

@ -83,6 +83,10 @@ private:
// clipped polygons (gpc format)
TGPolyList clipped_polys;
// Fixed elevations (from polygon input data with z values
// pre-specified)
TGTriNodes fixed_elevations;
// raw node list (after triangulation)
TGTriNodes tri_nodes;
@ -148,6 +152,11 @@ public:
inline TGPolyList get_clipped_polys() const { return clipped_polys; }
inline void set_clipped_polys( TGPolyList p ) { clipped_polys = p; }
// Fixed elevations (from polygon input data with z values
// pre-specified)
inline TGTriNodes get_fixed_elevations() const { return fixed_elevations; }
inline void set_fixed_elevations( TGTriNodes n ) { fixed_elevations = n; }
// node list (after triangulation)
inline TGTriNodes get_tri_nodes() const { return tri_nodes; }
inline void set_tri_nodes( TGTriNodes n ) { tri_nodes = n; }

View file

@ -404,6 +404,7 @@ static int load_polys( TGConstruct& c ) {
// update main data repository
c.set_clipped_polys( clipper.get_polys_clipped() );
c.set_fixed_elevations( clipper.get_fixed_elevations() );
return count;
}
@ -494,11 +495,19 @@ static void fix_point_heights( TGConstruct& c, const TGArray& array )
point_list raw_nodes = c.get_tri_nodes().get_node_list();
for ( i = 0; i < (int)raw_nodes.size(); ++i ) {
cout << " fixing = " << raw_nodes[i] << " = ";
cout << " fixing = " << raw_nodes[i] << " ";
int index = c.get_fixed_elevations().find( raw_nodes[i] );
if ( index >= 0 ) {
// found an elevation we want to preserve
z = c.get_fixed_elevations().get_node(index).z();
cout << " forced = " << z << endl;
} else {
// interpolate point from DEM data.
z = array.interpolate_altitude( raw_nodes[i].x() * 3600.0,
raw_nodes[i].y() * 3600.0 );
cout << " interpolated = " << z << endl;
}
raw_nodes[i].setz( z );
cout << raw_nodes[i].z() << endl;
}
cout << "flattening ocean connected nodes" << endl;

View file

@ -89,6 +89,9 @@ static void clip_and_write_poly( string root, long int p_index, AreaType area,
*/
result = polygon_int( base, shape );
if ( preserve3d ) {
result.inherit_elevations( shape );
}
if ( result.contours() > 0 ) {
long int t_index = b.gen_index();