From aead9a1f9d7db22954112edfed3bc7ad410a17b0 Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Mon, 15 Oct 2012 22:15:16 +0200 Subject: [PATCH] USGS map file is only needed when --cover is enabled. Also put the log output into the respective functions --- src/BuildTiles/Main/main.cxx | 11 +++-------- src/BuildTiles/Main/priorities.cxx | 3 ++- src/BuildTiles/Main/usgs.cxx | 3 ++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/BuildTiles/Main/main.cxx b/src/BuildTiles/Main/main.cxx index 640e918e..012938cf 100644 --- a/src/BuildTiles/Main/main.cxx +++ b/src/BuildTiles/Main/main.cxx @@ -152,16 +152,11 @@ int main(int argc, char **argv) { load_dirs.push_back(argv[i]); SG_LOG(SG_GENERAL, SG_ALERT, "Load directory: " << argv[i]); } - SG_LOG(SG_GENERAL, SG_ALERT, "Priorities file is " << priorities_file); - if ( ! load_area_types( priorities_file ) ) { - SG_LOG(SG_GENERAL, SG_ALERT, "Failed to load priorities file " << priorities_file); + + if ( !load_area_types( priorities_file ) + || (!cover.empty() && !load_usgs_map( usgs_map_file)) ) { exit(-1); } - SG_LOG(SG_GENERAL, SG_ALERT, "USGS Map file is " << usgs_map_file); - if ( ! load_usgs_map( usgs_map_file ) ) { - SG_LOG(SG_GENERAL, SG_ALERT, "Failed to load USGS map file " << usgs_map_file); - exit(-1); - } // main construction data management class : Stage 1 if (tile_id == -1) { diff --git a/src/BuildTiles/Main/priorities.cxx b/src/BuildTiles/Main/priorities.cxx index 666b29fb..a9cc53e6 100644 --- a/src/BuildTiles/Main/priorities.cxx +++ b/src/BuildTiles/Main/priorities.cxx @@ -64,9 +64,10 @@ int load_area_types( const std::string& filename ) { ifstream in ( filename.c_str() ); if ( ! in ) { - SG_LOG(SG_GENERAL, SG_ALERT, "Unable to open file " << filename); + SG_LOG(SG_GENERAL, SG_ALERT, "Unable to open priorities file " << filename); return 0; } + SG_LOG(SG_GENERAL, SG_ALERT, "Priorities file is " << filename); in >> skipcomment; string sliver_area_name, default_area_name; diff --git a/src/BuildTiles/Main/usgs.cxx b/src/BuildTiles/Main/usgs.cxx index 7e783ba5..78da9274 100644 --- a/src/BuildTiles/Main/usgs.cxx +++ b/src/BuildTiles/Main/usgs.cxx @@ -38,9 +38,10 @@ int load_usgs_map( const std::string& filename ) { ifstream in ( filename.c_str() ); if ( ! in ) { - SG_LOG(SG_GENERAL, SG_ALERT, "Unable to open file " << filename); + SG_LOG(SG_GENERAL, SG_ALERT, "Unable to open USGS map file " << filename); return 0; } + SG_LOG(SG_GENERAL, SG_ALERT, "USGS Map file is " << filename); in >> skipcomment; while ( !in.eof() ) {