Check point ...
This commit is contained in:
parent
d05fd4a8ff
commit
aa37052182
6 changed files with 59 additions and 13 deletions
|
@ -500,8 +500,8 @@ void build_airport( string airport_raw, float alt_m,
|
||||||
string type_flag = runways[i].surface_flags.substr(2, 1);
|
string type_flag = runways[i].surface_flags.substr(2, 1);
|
||||||
if ( type_flag == "P" ) {
|
if ( type_flag == "P" ) {
|
||||||
build_runway( runways[i], elev * SG_FEET_TO_METER,
|
build_runway( runways[i], elev * SG_FEET_TO_METER,
|
||||||
&rwy_polys, &texparams, &accum, &apt_base,
|
&rwy_polys, &texparams, &accum,
|
||||||
&apt_clearing );
|
&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);
|
string type_flag = runways[i].surface_flags.substr(2, 1);
|
||||||
if ( type_flag == "R" || type_flag == "V" ) {
|
if ( type_flag == "R" || type_flag == "V" ) {
|
||||||
build_runway( runways[i], elev * SG_FEET_TO_METER,
|
build_runway( runways[i], elev * SG_FEET_TO_METER,
|
||||||
&rwy_polys, &texparams, &accum, &apt_base,
|
&rwy_polys, &texparams, &accum,
|
||||||
&apt_clearing );
|
&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")
|
if ( type_flag != string("P") && type_flag != string("R")
|
||||||
&& type_flag != string("V") ) {
|
&& type_flag != string("V") ) {
|
||||||
build_runway( runways[i], elev * SG_FEET_TO_METER,
|
build_runway( runways[i], elev * SG_FEET_TO_METER,
|
||||||
&rwy_polys, &texparams, &accum, &apt_base,
|
&rwy_polys, &texparams, &accum,
|
||||||
&apt_clearing );
|
&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(),
|
point_list geod_nodes = calc_elevations( apt_surf, nodes.get_node_list(),
|
||||||
0.0 );
|
0.0 );
|
||||||
divided_base = calc_elevations( apt_surf, divided_base, 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()");
|
SG_LOG(SG_GENERAL, SG_DEBUG, "Done with base calc_elevations()");
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,9 @@ bool TGClipper::load_polys(const string& path) {
|
||||||
}
|
}
|
||||||
p = Point3D(startx, starty, startz);
|
p = Point3D(startx, starty, startz);
|
||||||
poly.add_node( i, p );
|
poly.add_node( i, p );
|
||||||
fixed_elevations.unique_add( p );
|
if ( poly3d ) {
|
||||||
|
fixed_elevations.unique_add( p );
|
||||||
|
}
|
||||||
|
|
||||||
for ( j = 1; j < count - 1; ++j ) {
|
for ( j = 1; j < count - 1; ++j ) {
|
||||||
in >> x;
|
in >> x;
|
||||||
|
@ -141,7 +143,9 @@ bool TGClipper::load_polys(const string& path) {
|
||||||
}
|
}
|
||||||
p = Point3D( x, y, z );
|
p = Point3D( x, y, z );
|
||||||
poly.add_node( i, p );
|
poly.add_node( i, p );
|
||||||
fixed_elevations.unique_add( p );
|
if ( poly3d ) {
|
||||||
|
fixed_elevations.unique_add( p );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
in >> lastx;
|
in >> lastx;
|
||||||
|
@ -159,7 +163,9 @@ bool TGClipper::load_polys(const string& path) {
|
||||||
} else {
|
} else {
|
||||||
p = Point3D( lastx, lasty, lastz );
|
p = Point3D( lastx, lasty, lastz );
|
||||||
poly.add_node( i, p );
|
poly.add_node( i, p );
|
||||||
fixed_elevations.unique_add( p );
|
if ( poly3d ) {
|
||||||
|
fixed_elevations.unique_add( p );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
src/BuildTiles/Main/README
Normal file
17
src/BuildTiles/Main/README
Normal 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
|
||||||
|
|
|
@ -83,6 +83,10 @@ private:
|
||||||
// clipped polygons (gpc format)
|
// clipped polygons (gpc format)
|
||||||
TGPolyList clipped_polys;
|
TGPolyList clipped_polys;
|
||||||
|
|
||||||
|
// Fixed elevations (from polygon input data with z values
|
||||||
|
// pre-specified)
|
||||||
|
TGTriNodes fixed_elevations;
|
||||||
|
|
||||||
// raw node list (after triangulation)
|
// raw node list (after triangulation)
|
||||||
TGTriNodes tri_nodes;
|
TGTriNodes tri_nodes;
|
||||||
|
|
||||||
|
@ -148,6 +152,11 @@ public:
|
||||||
inline TGPolyList get_clipped_polys() const { return clipped_polys; }
|
inline TGPolyList get_clipped_polys() const { return clipped_polys; }
|
||||||
inline void set_clipped_polys( TGPolyList p ) { clipped_polys = p; }
|
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)
|
// node list (after triangulation)
|
||||||
inline TGTriNodes get_tri_nodes() const { return tri_nodes; }
|
inline TGTriNodes get_tri_nodes() const { return tri_nodes; }
|
||||||
inline void set_tri_nodes( TGTriNodes n ) { tri_nodes = n; }
|
inline void set_tri_nodes( TGTriNodes n ) { tri_nodes = n; }
|
||||||
|
|
|
@ -404,6 +404,7 @@ static int load_polys( TGConstruct& c ) {
|
||||||
|
|
||||||
// update main data repository
|
// update main data repository
|
||||||
c.set_clipped_polys( clipper.get_polys_clipped() );
|
c.set_clipped_polys( clipper.get_polys_clipped() );
|
||||||
|
c.set_fixed_elevations( clipper.get_fixed_elevations() );
|
||||||
|
|
||||||
return count;
|
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();
|
point_list raw_nodes = c.get_tri_nodes().get_node_list();
|
||||||
|
|
||||||
for ( i = 0; i < (int)raw_nodes.size(); ++i ) {
|
for ( i = 0; i < (int)raw_nodes.size(); ++i ) {
|
||||||
cout << " fixing = " << raw_nodes[i] << " = ";
|
cout << " fixing = " << raw_nodes[i] << " ";
|
||||||
z = array.interpolate_altitude( raw_nodes[i].x() * 3600.0,
|
int index = c.get_fixed_elevations().find( raw_nodes[i] );
|
||||||
raw_nodes[i].y() * 3600.0 );
|
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 );
|
raw_nodes[i].setz( z );
|
||||||
cout << raw_nodes[i].z() << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "flattening ocean connected nodes" << endl;
|
cout << "flattening ocean connected nodes" << endl;
|
||||||
|
|
|
@ -89,6 +89,9 @@ static void clip_and_write_poly( string root, long int p_index, AreaType area,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
result = polygon_int( base, shape );
|
result = polygon_int( base, shape );
|
||||||
|
if ( preserve3d ) {
|
||||||
|
result.inherit_elevations( shape );
|
||||||
|
}
|
||||||
|
|
||||||
if ( result.contours() > 0 ) {
|
if ( result.contours() > 0 ) {
|
||||||
long int t_index = b.gen_index();
|
long int t_index = b.gen_index();
|
||||||
|
|
Loading…
Reference in a new issue