1
0
Fork 0

Clip all land use data to GSHHS land mask so that lower res data won't

mess up our coast lines.
Changed some default names of Work directories ...
Add in support for GSHHS lakes, islands, and ponds.
Updated stats for parallel scenery build server.
This commit is contained in:
curt 2000-05-06 19:55:30 +00:00
parent 6f371199c1
commit 07e2840980
5 changed files with 54 additions and 18 deletions

View file

@ -33,6 +33,9 @@
#include "clipper.hxx"
#define MASK_CLIP 1
// Constructor
FGClipper::FGClipper( void ) {
}
@ -291,6 +294,17 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
polys_in.safety_base.add_node( 0, Point3D(max.x, max.y, 0.0) );
polys_in.safety_base.add_node( 0, Point3D(min.x, max.y, 0.0) );
// set up land mask, we clip most things to this since it is our
// best representation of land vs. ocean. If we have other less
// accurate data that spills out into the ocean, we want to just
// clip it.
FGPolygon mask;
mask.erase();
for ( int i = 0; i < (int)polys_in.polys[DefaultArea].size(); ++i ) {
result_union = polygon_union( mask, polys_in.polys[DefaultArea][i] );
mask = result_union;
}
// int count = 0;
// process polygons in priority order
for ( int i = 0; i < FG_MAX_AREA_TYPES; ++i ) {
@ -304,12 +318,12 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
FG_LOG( FG_CLIPPER, FG_DEBUG, get_area_name( (AreaType)i )
<< " = " << current.contours() );
#ifdef EXTRA_SAFETY_CLIP
// clip to base tile
tmp = polygon_int( current, polys_in.safety_base );
#else
tmp = current;
#endif
if ( i > HoleArea ) {
// clip to land mask
tmp = polygon_int( current, mask );
} else {
tmp = current;
}
// clip current polygon against previous higher priority
// stuff

View file

@ -104,19 +104,37 @@ int load_polys( FGConstruct& c ) {
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load hydro
// load GSHHS land masses
poly_path = c.get_work_base() + "/GSHHS-LandMass/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load GSHHS lakes
poly_path = c.get_work_base() + "/GSHHS-Lakes/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load GSHHS islands
poly_path = c.get_work_base() + "/GSHHS-Islands/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load GSHHS ponds
poly_path = c.get_work_base() + "/GSHHS-Ponds/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load USA hydro data
poly_path = c.get_work_base() + "/USA-Hydro/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load land masses
poly_path = c.get_work_base() + "/Global-LandMass/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
cout << " loaded " << count << " total polys" << endl;
// load urban areas
// load USA urban areas
poly_path = c.get_work_base() + "/USA-Urban/" + base;
cout << "poly_path = " << poly_path << endl;
count += actual_load_polys( poly_path, c, clipper );
@ -692,7 +710,7 @@ int main(int argc, char **argv) {
cout << "result of setting mem limit = " << result << endl;
// cpu time limit since occassionally the triangulator can go into
// and infinite loop.
// an infinite loop.
limit.rlim_cur = 120;
limit.rlim_max = 120;
result = setrlimit( RLIMIT_CPU, &limit );

View file

@ -1,4 +1,4 @@
EXTRA_DIST fgfs-launch-clients fgfs-launch-server genworklist.sh
EXTRA_DIST=fgfs-launch-clients fgfs-launch-server genworklist.sh
bin_PROGRAMS = fgfs-tools-server fgfs-tools-client

View file

@ -220,7 +220,12 @@ long int get_next_tile() {
seconds = tmp_time;
cout << "Current tile per second rate = " << counter << endl;
cout << "Overall tile per second rate = "
<< global_counter / ( seconds - start_seconds ) << endl;
<< (double)global_counter / (double)(seconds - start_seconds)
<< endl;
cout << "Overall tile per hour rate = "
<< (double)global_counter * 3600.0 /
(double)(seconds - start_seconds)
<< endl;
counter = 0;
}

View file

@ -526,4 +526,3 @@ int FGTriangle::run_triangulate( const string& angle, const int pass ) {
return 0;
}