VR GIS
This page updated: April, 2011
DTM Digital Terrain Mapping
DTM HTF form:
Processing a .dem file into a .htf is required for use in Digital Terrain Mapping. The DEM page processes dem(s) into .bit file(s) and the Dem Db List form processes a database of dem files into a .tpcfg and or a .shp file (a .tpcfg can be made manually using a text editor). A single dem can be processed into a HTF without intermediate conversion into a .bit and the .tpcfg file used for processing the .bit(s). Some knowledge of the file is required to fill in the HTF page of the HTF Pack form. This information is normally gleaned from the dem during processing into a .bit/.tpcfg and then loaded into the form when the .tpcfg is opened for processing. Following are examples for: entering 1 file w/o a .tpcfg, "DTM .tpcfg how to" is an explanation/example of a 1 file .tpcfg, a "complicated" .tpcfg walk-though, "building" is a walk-through step by step of entering multiple files w/o a ready made .tpcfg.
The area to the right of the text "HTF output" contains the Drive \ Directory \ filename of the htf file to be MADE (the file should not exist yet and has a .htf extension)
The area to the right of the text "WorldSize" contains the X Width (Total) of the data
then to the right of the text "x" Y Height (Total) of the data
WorldSize is the size of the HTF (usually matches that of your reference bitmap/DEM, but can be larger or smaller as well depending on your needs).
WorldSize MUST be a power of 2... just enter the data and click the Auto fit to Tile and the data will be computed when the .tpcfg is Processed :)
Underneath is a Checkbox to automatically enlarges "WorldSize" X and Y to next larger Tile Size... Check the box and during processing the X and Y values will be computed and changed... Save the .tpcfg after processing to store the values.
then to the right of the text "Tile Size" (usually 129 or 257.. should ALWAYS be smaller than the Height or width, and a multiple of 2^+1 : 17, 33, 65, 129, 257, 513) (Tiles are the divisions of the htf into smaller parts) * TileSize: has to be 1 greater than the tile size used by the terrainrender (why??) Tile data overlaps, a tile with 64 "squares" requires 65 samples for instance, with 1 sample overlap for adjacent tiles. Overlap value of 2 can be of use when derivating the terrain curve (for normalmapping).
Underneath "Tile Size" and to the right of the text "Overlap" (usually 1 or 2)
then to the right of the text "Default height" the default value used for filling blank spaces (0)(what this is depends on the data and if it was processed into a .bit)
Underneath "Default height" and to the right of the text"Filter to default" use the value to be replaced by "Default height" (-32768) or leave blank
"ZScale": scaling of all z values (leave it blank, input a 1, or dont ask me)
Underneath "ZScale" is a Checkbox WholeTiles: Indicates if partial tiles should be placed in the HTF or not, only meaningful if your world size and original DEM/bitmap data size doesn't match (can happen for "real" data, which was sampled at some real-world dimensions, but you restrict your HTF world to the nearest power of two dimension f.i.).
then to the right of the text "DEMPath" the Drive \ Directory \ location of the actual data file(s) to be converted (Directory location Not the file name(s))
Note that the "HTF output" and "DEMPath" areas have buttons [...] that may be used to locate the files (except the htf file does not exist yet so another file may be selected and then the name changed)
Beneath this area are 4 "columns" that have to be filled/selected for each file to be compiled into the .htf.
If "DEMPath" is valid then clicking in the area beneath "File Name" will create a drop down box containing the files in the "DEMPath" directory (If it is not a valid directory then make it so).
"World Offset" normally is 0,0 for a single file. What does 'world offset' do? Indicates where, in world coordinates, the DEM is. Used when MANY data sets are combined.. will fill blank areas with the "Default height"
"Size" is a conjugated "WorldSize" in text format for a single file, else it is the size of THIS file (when processing only 1 file).
"Data Type" is a drop down box offering the available data types: Select the one defining the dem file data. (normally either Intel or not for integers) ( or single for floating point data) (Conversion of dem files into .bit on the DEM page handles other data types...)
16 bits (Intel)
16 bits unsigned(Intel)
16 bits (non-Intel)
VTP BT (single)
BMP (Windows)
32 bits FP ([0;1],Intel)
bit 32 (single)
bit 16 (Intel)
After all the blanks are filled in press the World link button or [HTF][Process] menu item to process the file into a .htf (and/or Save it as a .tpcfg).
DTM .tpcfg how to
.tpcfg files contain the information to process 1..many dem files into 1 compressed HTF file. Examples exist for Etopo5, Etopo2, Gtopo30, Stopo30(SRTM) and Globe: the standard government global data sets. All data represent the same "area" per cell per HTF tpcfg (square pixels - in designated format: Degrees or Distance or ?).
The simplest example is the ETOPO5 file which covers the world as 1 file : TerrainBase/ETOPO5, from the NOAA National Data Center/NGDC (18 MB uncompressed). http://www.ngdc.noaa.gov/seg/fliers/se-1104.shtml
There are 11 lines in a .tpcfg (although the 11th line may be VERY long). {4320 becomes 4352, 2160 becomes 2176 prior tp processing}
Actually if some lines are left out it is OK.. they get Default values. In the example below [ ] is placed around several that can be blank.
HTFName=F:\HTF\tbase.htf
WorldSizeX=4320
WorldSizeY=2160
TileSize=129
TileOverlap=1
DefaultZ=0
[FilterZ=-32768]
[ZScale=1]
DEMPath=F:\dems
[WholeTiles=1]
DEMs="tbase.bin,""0,0"",4320x2160,""16 bits (Intel)"""
After loading the .tpcfg file into HTF Pack the data will be displayed prior to processing. Verify that the data is correctly placed into the space after the = (the "File Name" can get confused if processing many .tpcfg's ... simply click the area and it should "revert" to the correct file name, else select the correct file name...)
HTFName=contains the Drive \ Directory \ filename of the htf file to be MADE (the file should not exist yet)
WorldSizeX=X Width (Total) of the data
WorldSizeY=Y Height (Total) of the data
TileSize= (usually 129 or 257.. should ALWAYS be smaller than the Height or width, and a multiple of 2^ 17, 33, 65, 129, 257)
TileOverlap=1
DefaultZ= the default value used for filling blank spaces
FilterZ= 32768
DEMPath= This line may be very long... repeating values per each input file to be processed. For Etopo5 and Etopo2 it is only 1 set of values as all data is in 1 file.
GTOPO and GLOBE (287 MB compressed, expands to 1.7GB) contain several files of different x,y sizes, however they are not overlapping nor missing areas (other than the oceans- but values are there.. just all the same) (its the old missing - blank - 0 - designated hitter paradigm)
Make a copy of the etopo5.tpcfg, gtopo.tpcfg, and globe.tpcfg files; change the extension to .txt; double click them to open, then print to compare - evaluate - learn (especially the gtopo<>globe file sizes)... then change the extension back to use them.
DTM .tpcfg ... a little more complicated
the .tpcfg file for the USA 1 degree dems is a little more complicated, and 24k dems should probably be divided into areas for processing (I suggest 1 degree groups of 64 cells). (Better yet is the current srtm 1AS demo data 1 degree cells). The 250k dem htf file is over 1 gig and a 24k htf would be ~64 times that size! It took 10 hours to process the 250k dems ((935 files) 2.5 gig of .bit data preprocessed from ~10 gig of ascii .dem files) into a ~1 gig .htf on my 400 Mhz computer. HTF files take only milliseconds to view which is the amazing reason to learn-do all this.
Note: the following .tpcfg has linefeeds in the 11th line for ease of comparison... there are no linefeeds in line 11 of the actual .tpcfg file. {sundry comments added}. Note that the line has NO , at the END either. Each 'set of values' is: filename; X,Y start place for this file; X,Y size of this file; type of data; ?always empty""?.
HTFName=E:\HTF\bin250.htf
WorldSizeX=72001
WorldSizeY=31201
TileSize=129
TileOverlap=1
DefaultZ=0
FilterZ=-32767
[ZScale=1]
DEMPath=E:\dems\dem 250\Bins\
[WholeTiles=1]
DEMs=
{for this tpcfg the first tile is NOT at 0,0}
"kenora-w.bin,""36000,0"",1201x1201,""bin 16 (Intel)""",
{for dems 1201 points have 1 point overlap H and V}
"kenora-e.bin,""37200,0"",1201x1201,""bin 16 (Intel)""",
{the next 'line' of dems, start 1 tile in}
"cape_flattery-e.bin,""1200,1200"",1201x1201,""bin 16 (Intel)""",
{the next tile in line}
"victoria-w.bin,""2400,1200"",1201x1201,""bin 16 (Intel)""",
...
{the last tile in line}
"thunder_bay-e.bin,""44400,1200"",1201x1201,""bin 16 (Intel)""",
{the next 'line' of dems, also start 1 tile in}
"copalis_beach-e.bin,""1200,2400"",1201x1201,""bin 16 (Intel)""",
"seattle-w.bin,""2400,2400"",1201x1201,""bin 16 (Intel)""",
...
{some time later, the last in a line}
"fort_pierce-e.bin,""54000,26400"",1201x1201,""bin 16 (Intel)""",
{next line, starts WAY in}
"mc_allen-w.bin,""31200,27600"",1201x1201,""bin 16 (Intel)""",
"mc_allen-e.bin,""32400,27600"",1201x1201,""bin 16 (Intel)""",
"port_isabel-w.bin,""33600,27600"",1201x1201,""bin 16 (Intel)""",
{and skips some tiles}
"charlotte_harbor-e.bin,""51600,27600"",1201x1201,""bin 16 (Intel)""",
"west_palm_beach-w.bin,""52800,27600"",1201x1201,""bin 16 (Intel)""",
"west_palm_beach-e.bin,""54000,27600"",1201x1201,""bin 16 (Intel)""",
{next line, starts WAY in too}
"brownsville-w.bin,""33600,28800"",1201x1201,""bin 16 (Intel)""",
{skips over to Florida}
"miami-w.bin,""52800,28800"",1201x1201,""bin 16 (Intel)""",
"miami-e.bin,""54000,28800"",1201x1201,""bin 16 (Intel)""",
{last line, starts at Florida}
"key_west-w.bin,""52800,30000"",1201x1201,""bin 16 (Intel)""",
{last tile of last line: NO , at end}
"key_west-e.bin,""54000,30000"",1201x1201,""bin 16 (Intel)"""
Note that 30000 + 1201 = WorldSizeY=31201; the X Width widest part was near the top of the HTF. All the files-tiles lose 1 point from being overlapped by the next, except the last tiles point.
- DTM .tpcfg building: Add em in 1 at a time
- Compiling 16 files as a 4x4 group of srtm 1AS 3601x3601 data {notes}
- "HTF output": Select the directory/file using the [...] button and then change the filename to ?.htf {stl.htf}
- "WorldSize": 14401x14401 {3600x4=14400+1}
- "Tile Size": 129 {someday autosize to ? max to fit 360x180}
- "Default height": 0 {srtm missing data is -32768, but it is ALL land} {actually and truthfully I converted all to .bits so the missing data: lakes and rivers would be converted to 0, as there is data there - just it is -32768 and that makes for WEIRD topography and trashes the 3D view}
- "DEMPath": E:\dems\srtm\ {use [...] to locate them}
- Review... .
Beneath this area are 4 "columns" that have to be filled/selected.
If "DEMPath" is valid clicking in the area beneath "File Name" will create a drop down box containing the files in the "DEMPath" directory (If it is not a valid directory then make it so).
"World Offset" normally is 0,0 for a single file, for a group of files it changes for each file.
"Size" is the x,y size of THIS data file.
"Data Type" is a drop down box offering the available data types: Select the one defining the dem file data. (normally either Intel or not for integers) ( or single for floating point data) (Conversion of dem files into .bit on the DEM page handles other data types...)
Repeat until finished
- The 4 columns are filled in for each data file in the group. Each set below describes 1 data file. Use the "Add data set" button to make a new row prior to entering in the data for each file. Click to enter an area, click again to 'set' the data entry.
- ...File 1-1 .
"File Name" N40W92.hgt {use the drop-down box to select it}
"World Offset" 0,0 {a simple square set}
"Size" 3601x3601 {all these are same size for this example}
"Data Type" 16 bits (non-Intel) {use the drop-down box to select it}
- ...File 2-1 .
"File Name" N40W91.hgt
"World Offset" 3600,0
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 3-1 .
"File Name" N40W90.hgt
"World Offset" 7200,0
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 4-1 .
"File Name" N40W89.hgt
"World Offset" 10800,0 {10800+3601=14401}
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 1-2 .
"File Name" N39W92.hgt
"World Offset" 0,3600
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 2-2 .
"File Name" N39W91.hgt
"World Offset" 3600,3600
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 3-2 .
"File Name" N39W90.hgt
"World Offset" 7200,3600
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 4-2 .
"File Name" N39W89.hgt
"World Offset" 10800,3600
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 1-3 .
"File Name" N38W92.hgt
"World Offset" 0,7200
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 2-3 .
"File Name" N38W91.hgt
"World Offset" 3600,7200
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 3-3 .
"File Name" N38W90.hgt
"World Offset" 7200,7200
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 4-3 .
"File Name" N38W89.hgt
"World Offset" 10800,7200
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 1-4 .
"File Name" N37W92.hgt
"World Offset" 0,10800
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 2-4 .
"File Name" N37W91.hgt
"World Offset" 3600,10800
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 3-4 .
"File Name" N37W90.hgt
"World Offset" 7200,10800
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- ...File 4-4 .
"File Name" N37W89.hgt
"World Offset" 10800,10800
"Size" 3601x3601
"Data Type" 16 bits (non-Intel)
- This can now be saved as a .tpcfg and/or processed into a .htf file.
DTM .tpcfg ???:
- How about a Raster Image htf?
- .rtf is used so maybe .rif ???... 7 'layers' ?... no, must be a variable number of bands per image set. Band data type (Radar is 48..16 bits, most image datum are 8 bits: byte). Bands/method used for combining into a 24-or-32 bit image.
- Data sets for Terrain Rendering: ?
- See dtm data sources.doc... a 360x180 array of Terrain, Image, Shape, Metadata availability... linked to a 'list' of the directory/filename location strings...direct data access...too big to keep in memory.
Copyright © 1991..2011 by Ivan Lee Herring