Changes to process 30 arcsec binary DEM files.
This commit is contained in:
parent
d6ba1a7188
commit
73a1b3e6d2
3 changed files with 84 additions and 18 deletions
|
@ -32,7 +32,7 @@
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
fgRAWDEM raw;
|
fgRAWDEM raw;
|
||||||
char basename[256], output_dir[256], hdr_file[256], dem_file[256];
|
char basename[256], output_dir[256], hdr_file[256], dem_file[256];
|
||||||
int i;
|
int i, start_lat, end_lat;
|
||||||
|
|
||||||
if ( argc != 3 ) {
|
if ( argc != 3 ) {
|
||||||
printf("Usage: %s <input_file_basename> <output_dir>\n", argv[0]);
|
printf("Usage: %s <input_file_basename> <output_dir>\n", argv[0]);
|
||||||
|
@ -62,7 +62,11 @@ int main(int argc, char **argv) {
|
||||||
/* open up the raw data file */
|
/* open up the raw data file */
|
||||||
rawOpenDemFile(&raw, dem_file);
|
rawOpenDemFile(&raw, dem_file);
|
||||||
|
|
||||||
for ( i = 41; i <= 90; i++ ) {
|
end_lat = raw.rooty / 3600;
|
||||||
|
start_lat = end_lat - ((raw.nrows * raw.ydim) / 3600);
|
||||||
|
printf("Latitude ranges from %d to %d\n", start_lat, end_lat);
|
||||||
|
|
||||||
|
for ( i = start_lat + 1; i <= end_lat; i++ ) {
|
||||||
rawProcessStrip(&raw, i, output_dir);
|
rawProcessStrip(&raw, i, output_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,9 +78,12 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1998/03/03 13:10:28 curt
|
/* Revision 1.3 1998/03/03 21:54:50 curt
|
||||||
/* Close to a working version.
|
/* Changes to process 30 arcsec binary DEM files.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1998/03/03 13:10:28 curt
|
||||||
|
* Close to a working version.
|
||||||
|
*
|
||||||
* Revision 1.1 1998/03/02 23:31:01 curt
|
* Revision 1.1 1998/03/02 23:31:01 curt
|
||||||
* Initial revision.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
|
|
|
@ -62,15 +62,15 @@ source-tar: clean
|
||||||
(cd ..; \
|
(cd ..; \
|
||||||
tar cvzf demtools-$(FG_VERSION).tar.gz Tools/Makefile Tools/README \
|
tar cvzf demtools-$(FG_VERSION).tar.gz Tools/Makefile Tools/README \
|
||||||
Tools/Todo Tools/make.inc Tools/process-dem.pl Tools/AssemTris \
|
Tools/Todo Tools/make.inc Tools/process-dem.pl Tools/AssemTris \
|
||||||
Tools/Dem2node Tools/FixNode Tools/FixObj Tools/SplitTris \
|
Tools/Dem2node Tools/DemRaw2Ascii Tools/FixNode Tools/FixObj \
|
||||||
Tools/Stripe_u Tools/Tri2obj Tools/Triangle)
|
Tools/SplitTris Tools/Stripe_u Tools/Tri2obj Tools/Triangle)
|
||||||
|
|
||||||
source-zip: clean
|
source-zip: clean
|
||||||
(cd ..; \
|
(cd ..; \
|
||||||
zip -r demtools-$(FG_VERSION).zip Tools/Makefile Tools/README \
|
zip -r demtools-$(FG_VERSION).zip Tools/Makefile Tools/README \
|
||||||
Tools/Todo Tools/make.inc Tools/process-dem.pl Tools/AssemTris \
|
Tools/Todo Tools/make.inc Tools/process-dem.pl Tools/AssemTris \
|
||||||
Tools/Dem2node Tools/FixNode Tools/FixObj Tools/SplitTris \
|
Tools/Dem2node Tools/DemRaw2Ascii Tools/FixNode Tools/FixObj \
|
||||||
Tools/Stripe_u Tools/Tri2obj Tools/Triangle)
|
Tools/SplitTris Tools/Stripe_u Tools/Tri2obj Tools/Triangle)
|
||||||
|
|
||||||
bin-tar: all
|
bin-tar: all
|
||||||
echo "need to fix this"
|
echo "need to fix this"
|
||||||
|
@ -90,6 +90,9 @@ bin-zip:
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.11 1998/03/03 21:54:43 curt
|
||||||
|
# Changes to process 30 arcsec binary DEM files.
|
||||||
|
#
|
||||||
# Revision 1.10 1998/03/03 15:36:11 curt
|
# Revision 1.10 1998/03/03 15:36:11 curt
|
||||||
# Tweaks for compiling with g++
|
# Tweaks for compiling with g++
|
||||||
#
|
#
|
||||||
|
|
76
Tools/README
76
Tools/README
|
@ -1,19 +1,75 @@
|
||||||
1. Start with file.dem
|
FG Scenery Tools README
|
||||||
|
=======================
|
||||||
|
|
||||||
2. dem2node file.dem tolerance^2 (meters)
|
Contained here-in are the FG scenery creation tools. These can be
|
||||||
|
used to convert 3 arcsec ASCII format DEM files and 30 arcsec binary
|
||||||
|
format DEM files into Flight Gear scenery.
|
||||||
|
|
||||||
- dem2node file.dem 160000
|
Eventually these tools will expand to support insertion of airports,
|
||||||
|
roads, rivers, lakes, etc.
|
||||||
|
|
||||||
3. triangle -q file
|
|
||||||
|
|
||||||
4. fixnode file
|
Building the Tools
|
||||||
|
==================
|
||||||
|
|
||||||
5. tri2obj file.1
|
These tools are compiled and tested under Linux. I'm all for
|
||||||
|
portability, but I just haven't been as motivated to port these tools,
|
||||||
|
since scenery creation is less of a general need ... especially at
|
||||||
|
this stage. However, if anyone wants to work on porting to other
|
||||||
|
platforms, I will be happy to incorporate patches.
|
||||||
|
|
||||||
6. strip file.1.obj
|
The process for building these tools is very similar to building the
|
||||||
|
main FG source code.
|
||||||
|
|
||||||
7. cp bands.d file-new.obj
|
1. Set the FG_ROOT, FG_ROOT_SRC, and FG_ROOT_LIB environment
|
||||||
|
variables.
|
||||||
|
|
||||||
8. fixobj file-new
|
2. Run ``make depend''
|
||||||
|
|
||||||
9. cp file-new.1.obj .../Scenery/...
|
3. Run ``make clean''
|
||||||
|
|
||||||
|
4. Run ``make''
|
||||||
|
|
||||||
|
|
||||||
|
3 Arcsec ASCII DEM files
|
||||||
|
========================
|
||||||
|
|
||||||
|
Data files for the USA are available in this format from:
|
||||||
|
|
||||||
|
http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html
|
||||||
|
|
||||||
|
To generate FG scenery from one of these dem files, run:
|
||||||
|
|
||||||
|
./process-dem.pl <error-tolerance-squared> dem-file-1 [ dem-file-2 ...]
|
||||||
|
|
||||||
|
You can vary the error tolerance to control the level of detail (and
|
||||||
|
size) of the resulting scenery. Note, you must specify the error
|
||||||
|
tolerance squared. So, if you wish to allow up to a 10 meter error
|
||||||
|
margin (very high level of detail) you would specify a value of 100.
|
||||||
|
If you desire an error tolerance of 200 meters (medium detail level)
|
||||||
|
you would specify a value of 40000.
|
||||||
|
|
||||||
|
The process-dem.pl script will automatically dump the resulting .obj
|
||||||
|
files in the proper directory tree.
|
||||||
|
|
||||||
|
|
||||||
|
30 Arcsec Binary DEM files
|
||||||
|
==========================
|
||||||
|
|
||||||
|
These data files have world wide coverage and are available from:
|
||||||
|
|
||||||
|
http://edcwww.cr.usgs.gov/landdaac/gtopo30/gtopo30.html
|
||||||
|
|
||||||
|
To process these data files, you must first run:
|
||||||
|
|
||||||
|
DemRaw2Ascii/raw2ascii <input_file_basename> <output_dir>
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
DemRaw2Ascii/raw2ascii /tmp/W020N90 asciidems/
|
||||||
|
|
||||||
|
This will create ASCII DEM files for each 1 degree x 1 degree area in
|
||||||
|
the specified output dir.
|
||||||
|
|
||||||
|
Then, you can take these ascii dem files and feed them through the
|
||||||
|
same procedure you use with the 3 arcsec dem files.
|
Loading…
Reference in a new issue