Game Development Community

Merging terrain data from different DEM files

by Ray Depew · in Torque Game Engine · 12/08/2004 (7:36 pm) · 1 replies

For a couple of projects I'm working on, the data for the terrain I'm modeling comes from SDTS data. Actually, it's from a corner of the terrain mapped in the SDTS DEM file. To really do a good job on the terrain, I have to get the three adjacent maps and somehow stitch them all together.

Earlier I described the MicroDEM tool available for free from
http://www.wood.army.mil/
, and how to use MicroDEM to turn SDTS data into a heightmap suitable for use in Torque. I had already experimented with using MicroDEM to create heightmap PNGs of the four adjacent SDTS datasets, merge them in a graphics program like Adobe Photoshop or PaintShop Pro and touch up the seams so they're no longer visible.

Then I found that MicroDEM can do the merging for you. It does a much cleaner job. Here are the instructions I passed around Horsetooth Technology, Inc. about doing the merge. I tried it on the Copper Mountain, Vail Pass, Breckenridge and Frisco quadrangles, and it made a seamless merge -- okay, except for one "seam". MicroDEM put a huge fault -- a rift in the ridge behind the Breckenridge ski resort. Fortunately, it was very easy to merge the maps in MicroDEM and fill the rift in the graphics program or in Torque's terraform editor.

Next message is the instructions.

--
Regards
Ray Depew
Horsetooth Technologies, Inc.

#1
12/08/2004 (7:42 pm)
Merging SDTS files inside MicroDem
----------------------------------
Ray Depew
6 Dec 2004

Getting the files first
-----------------------
Download the SDTS files from whatever source you normally use. Each SDTS
file is accompanied by a text file providing a description of the SDTS
file (or can be, if you download the text file, too). For example, here's
a partial listing of my Ski_game directory.

C:\RAY\SKI_GAME>dir *dem*
Volume in drive C has no label.
Volume Serial Number is 18E9-2BFF

Directory of C:\RAY\SKI_GAME

09/11/2004 06:40 PM 3,070,625 1658508.DEM.SDTS.TAR.GZ
09/11/2004 06:27 PM 985 1658508.DEM.SDTS.TXT
08/31/2004 11:46 PM 3,020,521 1658515.DEM.SDTS.TAR.GZ
08/31/2004 11:33 PM 991 1658515.DEM.SDTS.TXT
4 File(s) 6,093,122 bytes

Reading the text files tells me that file 165808 is the data for the Vail
Pass quadrangle, and 1658515 is the data for the Copper Mountain quadrangle. These two quadrangles are adjacent (which I knew, which is why I downloaded both of them -- ain't I smart?), so they can be merged seamlessly with MicroDem.

So, do it.
----------
Start up MicroDem. Pull up the Data Manipulation window in one of two
ways:

Either
1) select File-->Data Manipulation on the menu bar,

or
2) click on the "IN <--> OUT" icon on the icon bar.

If you're using the default configuration, then the
tenth icon on the icon bar is a double arrow with "IN" above the arrow and
"OUT" below it -- an "IN-OUT" icon. Hovering over the icon gives you a
"Data Manipulation" tooltip.

With the Data Manipulation window open, Select Merge-->DEMS on the menu
bar. A file selection window called "Open Merging" pops up. The software
behaves a little screwy at this point.
Select one of the files you want to
merge, say it's 1658508.DEM.SDTS.TAR, and click the "Open" button. Wait
for a one-line summary to appear in the Data Manipulation window, and then
the Open Merging window pops up again. Select another file to merge, say
it's 1658515.DEM.SDTS.TAR, and click the "Open" button.

If you have other files to merge, repeat the above steps for each file.

When you have no more files to merge, click the "Cancel" button.
Immediately, another file selection window pops up, but this time it's
called "merged DEM" and the "Open" button is a "Save" button. Enter a name
for your merged file and click on "Save".

MicroDEM will think a bit, blink a bit, show you your merged terrain, and
then invite you to "Click OK to close the merged DEM." You have no other
choice. Just do what it says.

Now, close the Data Manipulation window. Select File-->Open from the menu
bar and find your merged file.

Okay, now what?
---------------
Now you greyscale, crop, zoom, and generally abuse the terrain file like
normal, to get your desired heightmap. Remember that you can select Info
on the main menu bar or click on the Map Info icon (looks like ?{: ) in the
map window) to find the pixel size. Min and max elevations are given in
the text files accompanying the unmerged quadrangles; you will have to
manually determine the min and max elevation of your merged and manipulated
file by moving the mouse around the heightmap and watching the numbers in
the status bar.