diff --git a/README b/README index f560615a..796adcd2 100644 --- a/README +++ b/README @@ -46,56 +46,26 @@ Preprocessing Terrain TerraGear supports several terrain data sources: -1. 30-arcsec SRTM based terrain data covering the world (recommended - over other 30-arcsec data sources): +1. [Preferred] SRTM (version 3): + Void filled, 1-arc-sec and 3-arc-sec, near worldwide coverage. - ftp://edcsgs9.cr.usgs.gov/pub/data/srtm/SRTM30/ + https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/ - I don't recall the details at the moment for processing this data. - Probably similar to the processing of the GLOBE data. - -2. 30-arcsec world wide data: GLOBE project: - - http://www.ngdc.noaa.gov/seg/topo/globe.shtml - - a) First convert the "bin" DEM format to "ascii" DEM format using - "Prep/DemRaw2ascii/raw2ascii" - - b) Then process the resulting files with "Prep/DemChop/demchop" + a) Chop up each .zip files using "Prep/DemChop/hgtchop" -3. 30-arcsec world wide data: GTOPO30 data: - - http://edcwww.cr.usgs.gov/landdaac/gtopo30/gtopo30.html - - a) First convert the "bin" DEM format to "ascii" DEM format using - "Prep/DemRaw2ascii/raw2ascii" - - b) Then process the resulting files with "Prep/DemChop/demchop" - - -4. SRTM (version 1 & 2) (1 and 3-arcsec nearly world wide coverage): +2. SRTM (version 1 & 2): + May contain voids, 1-arc-sec and 3-arc-sec, near worldwide coverage. ftp://edcsgs9.cr.usgs.gov/pub/data/srtm/ a) Chop up each .zip files using "Prep/DemChop/hgtchop" -5. 3-arcsec ASCII DEM files: - - Generally, I recommend using the SRTM data over this older data - set, however in places like Alaska, there is no SRTM coverage so - this data is better than the 30 arcsec data. - - http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html - - a) Create the .arr.gz files using the "Prep/DemChop/demchop" utility. - - The result for any of these terrain sources should be a "work" tree with a .arr.gz file for each FG tile. -6. SRTM data comes with 'voids'. These are areas where their +3. SRTM versions 1 & 2 come with 'voids'. These are areas where their automated data processing system could not reliably determine the elevation. Often this happens over water, or over mountain peaks. There is a big chunk of the Grand Canyon missing, a big chunk of @@ -106,13 +76,13 @@ with a .arr.gz file for each FG tile. I half trust is the USGS 3 arcsec DEM data for the USA. So we can't fix voids outside the USA right now. - In the same directory as DemChop and HgtChop there is a "fillvoids" + In the same directory as HgtChop there is a "fillvoids" program. You might wish to run it with something like the following command line: find /export/fgfs05/curt/Work/SRTM2-North_America3 -name '*.arr.gz' -exec ./fillvoids {} /stage/fgfs05/curt/Work/USGS-DEM-USA-3 \; -7. After you create the .arr.gz files you have to create a +4. After you create the .arr.gz files you have to create a corresponding .fit.gz file for each of these. This is a data reduction step which fits a set of polygons to the raw terrain with a set of constraints on the maximum error allowed relative to the diff --git a/README.cygwin b/README.cygwin index d0436ec0..c1479a44 100644 --- a/README.cygwin +++ b/README.cygwin @@ -23,7 +23,6 @@ under Windows. If running the tools from the standard Win32 command prompt a lot of the tools have problems with directory creation - with the tools that try to create many subdirectories this can be a major problem. It is much better to run the tools from a Cygwin bash shell -- in this case only raw2ascii has a directory creation problem - the -output directory specified on the command line needs to be manually -created. +- the output directory specified on the command line needs to be +manually created. diff --git a/README.howto b/README.howto index de0f8e16..0eb189a3 100644 --- a/README.howto +++ b/README.howto @@ -21,24 +21,18 @@ Preparation and Preprocessing 1) DEM data. As the first step you have to download DEM for the area you need. (You -can get them from USGS site). If this is a 30 arc sec DEM (which is most -probable) you need to transfer this file into ASCII format using -raw2ascii +can get them from USGS site). -Usage: ./raw2ascii - -Here output dir is quite arbitrary as we will remove all the files from -it later. Then you have to chop files that we got into the tiles used for the -scenery generation. You should use demchop for this. As we already have +scenery generation. You should use hgtchop for this. As we already have a number of files I'm using the following Perl script #-------------------------------------------------------------------------- #!/usr/bin/perl -my @files=glob("./*.dem"); +my @files=glob("./*.hgt"); my $size=@files; for (my $i=0;$i<$size;$i++) { - system("demchop $files[$i] /home/anovikov/w020n90/Work/DEM-30"); + system("hgtchop $files[$i] /home/anovikov/w020n90/Work/SRTM-3"); } #-------------------------------------------------------------------------- diff --git a/src/Prep/DemChop/CMakeLists.txt b/src/Prep/DemChop/CMakeLists.txt index 1d29e622..889410e1 100644 --- a/src/Prep/DemChop/CMakeLists.txt +++ b/src/Prep/DemChop/CMakeLists.txt @@ -1,15 +1,5 @@ include_directories(${PROJECT_SOURCE_DIR}/src/Lib/terragear) -add_executable(demchop demchop.cxx) - -target_link_libraries(demchop - DEM - ${ZLIB_LIBRARY} - ${SIMGEAR_CORE_LIBRARIES} - ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}) - -install(TARGETS demchop RUNTIME DESTINATION bin) - add_executable(hgtchop hgtchop.cxx) target_link_libraries(hgtchop diff --git a/src/Prep/DemChop/demchop.cxx b/src/Prep/DemChop/demchop.cxx deleted file mode 100644 index 753fc0c0..00000000 --- a/src/Prep/DemChop/demchop.cxx +++ /dev/null @@ -1,104 +0,0 @@ -// demchop.cxx -- chop up a dem file into it's corresponding pieces and stuff -// them into the workspace directory -// -// Written by Curtis Olson, started March 1999. -// -// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id: demchop.cxx,v 1.13 2004-11-19 22:25:51 curt Exp $ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include -#include -#include - -#include - -#include -#include -#include - -#include - -using std::endl; -using std::cout; -using std::string; - - -int main(int argc, char **argv) { - sglog().setLogLevels( SG_ALL, SG_WARN ); - - if ( argc != 3 ) { - SG_LOG( SG_GENERAL, SG_ALERT, "Usage " << argv[0] << " " ); - return EXIT_FAILURE; - } - - auto start_time = std::chrono::high_resolution_clock::now(); - - string dem_name = argv[1]; - string work_dir = argv[2]; - - SGPath sgp( work_dir ); - sgp.append( "dummy" ); - sgp.create_dir( 0755 ); - - TGDem dem(dem_name); - dem.parse(); - dem.close(); - - SGGeod min = SGGeod::fromDeg(dem.get_originx() / 3600.0 + SG_HALF_BUCKET_SPAN, - dem.get_originy() / 3600.0 + SG_HALF_BUCKET_SPAN); - - SGGeod max = SGGeod::fromDeg( (dem.get_originx() + dem.get_cols() * dem.get_col_step()) / 3600.0 - SG_HALF_BUCKET_SPAN, - (dem.get_originy() + dem.get_rows() * dem.get_row_step()) / 3600.0 - SG_HALF_BUCKET_SPAN ); - SGBucket b_min( min ); - SGBucket b_max( max ); - - if ( b_min == b_max ) { - dem.write_area( work_dir, b_min ); - } else { - SGBucket b_cur; - int dx, dy, i, j; - - sgBucketDiff(b_min, b_max, &dx, &dy); - cout << "DEM file spans tile boundaries" << endl; - cout << " dx = " << dx << " dy = " << dy << endl; - - if ( (dx > 20) || (dy > 20) ) { - cout << "somethings really wrong!!!!" << endl; - return EXIT_FAILURE; - } - - for ( j = 0; j <= dy; j++ ) { - for ( i = 0; i <= dx; i++ ) { - b_cur = b_min.sibling(i, j); - dem.write_area( work_dir, b_cur ); - } - } - } - - auto finish_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed = finish_time - start_time; - std::cout << std::endl << "Elapsed time: " << elapsed.count() << " seconds" << std::endl << std::endl; - - return EXIT_SUCCESS; -} diff --git a/src/Prep/DemChop/process-DEM-30.sh b/src/Prep/DemChop/process-DEM-30.sh deleted file mode 100755 index 2bbdf828..00000000 --- a/src/Prep/DemChop/process-DEM-30.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash - -WORKDIR=$HOME/workdirs/world_scenery - -for f in $WORKDIR/SRTM-30-ASCII/*/*.dem; do - demchop $f $WORKDIR/SRTM-30 -done \ No newline at end of file diff --git a/src/Prep/TerraFit/terrafit.cc b/src/Prep/TerraFit/terrafit.cc index 43f5cdf2..7704632c 100644 --- a/src/Prep/TerraFit/terrafit.cc +++ b/src/Prep/TerraFit/terrafit.cc @@ -275,7 +275,7 @@ void usage(char* progname, const std::string& msg) { SG_LOG(SG_GENERAL,SG_INFO, "will produce a better surface approximation."); SG_LOG(SG_GENERAL,SG_INFO, ""); SG_LOG(SG_GENERAL,SG_INFO, "The input file must be a .arr.gz file such as that produced"); - SG_LOG(SG_GENERAL,SG_INFO, "by demchop or hgtchop utils."); + SG_LOG(SG_GENERAL,SG_INFO, "by the hgtchop utility."); SG_LOG(SG_GENERAL,SG_INFO, ""); SG_LOG(SG_GENERAL,SG_INFO, "Force will overwrite existing .arr.gz files, even if the input is older"); SG_LOG(SG_GENERAL,SG_INFO, ""); diff --git a/src/Prep/TerraFit/terrafit.py.in b/src/Prep/TerraFit/terrafit.py.in index af9714fc..0b22bf4b 100644 --- a/src/Prep/TerraFit/terrafit.py.in +++ b/src/Prep/TerraFit/terrafit.py.in @@ -184,7 +184,7 @@ def usage(msg=''): sys.stderr.write("will produce a better surface approximation.\n") sys.stderr.write("\n") sys.stderr.write("The input file must be a .arr.gz file such as that produced\n") - sys.stderr.write("by demchop or hgtchop utils.\n") + sys.stderr.write("by the hgtchop utility.\n") sys.stderr.write("\n") sys.stderr.write("**** NOTE ****:\n") sys.stderr.write("If a directory is input all .arr files in directory will be\n")