1
0
Fork 0

Added --chunk argument to simplify generating airports for a specific

chunk (like w130n30).
This commit is contained in:
david 2002-10-19 15:42:50 +00:00
parent 3a4ee63f3f
commit aaaa59235b

View file

@ -45,6 +45,7 @@
#include <simgear/misc/sgstream.hxx> #include <simgear/misc/sgstream.hxx>
#include <Polygon/index.hxx> #include <Polygon/index.hxx>
#include <Geometry/util.hxx>
#include "build.hxx" #include "build.hxx"
#include "convex_hull.hxx" #include "convex_hull.hxx"
@ -61,7 +62,8 @@ static void usage( int argc, char **argv ) {
SG_LOG(SG_GENERAL, SG_ALERT, SG_LOG(SG_GENERAL, SG_ALERT,
"Usage " << argv[0] << " --input=<apt_file> " "Usage " << argv[0] << " --input=<apt_file> "
<< "--work=<work_dir> [ --start-id=abcd ] [ --nudge=n ]" << "--work=<work_dir> [ --start-id=abcd ] [ --nudge=n ]"
<< "[--min-lon=<deg>] [--max-lon=<deg>] [--min-lat=<deg>] [--max-lat=<deg>]"); << "[--min-lon=<deg>] [--max-lon=<deg>] [--min-lat=<deg>] [--max-lat=<deg>]"
<< "[--chunk=<chunk>]");
} }
@ -104,6 +106,12 @@ int main( int argc, char **argv ) {
min_lat = atof( arg.substr(10).c_str() ); min_lat = atof( arg.substr(10).c_str() );
} else if ( arg.find("--max-lat=") == 0 ) { } else if ( arg.find("--max-lat=") == 0 ) {
max_lat = atof( arg.substr(10).c_str() ); max_lat = atof( arg.substr(10).c_str() );
} else if ( arg.find("--chunk=") == 0 ) {
tg::Rectangle rectangle = tg::parseChunk(arg.substr(8).c_str());
min_lon = rectangle.getMin().x();
min_lat = rectangle.getMin().y();
max_lon = rectangle.getMax().x();
max_lon = rectangle.getMax().y();
} else { } else {
usage( argc, argv ); usage( argc, argv );
exit(-1); exit(-1);