What is a DEM?

DickTurpin

GWR Man
Hi chaps,
Excuse my ignorance, but what is a DEM? I noticed when I downloaded one
of Angelahs' routes, she had a map placed on the boards, and then added
the track by following the track on the map. Is a DEM the same sort of thing,
and how is this done please.
 
To take this one step more...

The numbers represent the height of the land with 0 (zed) being sea level and the rest being more. These numbers are converted into greyscale and interpreted into mountains and valleys by programs such as TransDEM and MicroDEM.

The problem with these programs is they produce steps because the DEM numbers are reduced down to 256 levels of grey (really 0-255, inclusive). Sea level is represented by black and all others are represented by various shades of grey up to white, which is all stops on to represent the tallest point. TransDEM has a better go at the data and producing better results because its interpretation of the numbers is finer.

It's probably a lot more complicated than this, but this is how I understand it works.

John
 
Last edited:
One point:

To take this one step more...

The problem with these programs is they produce steps because the DEM numbers are reduced down to 256 levels of grey (really 0-255, inclusive).

Transdem processes the elevation data using one (or perhaps more) algorithms to smooth out the steps and give a smooth contour, so that the route segments produced by TransDEM are relatively pleasing.

ns.
 
The numbers represent the height of the land with 0 (zed) being sea level and the rest being more. These numbers are converted into greyscale and interpreted into mountains and valleys by programs such as TransDEM and MicroDEM.
John, that's only correct for the classic MicroDEM/HOG approach. TransDEM never did it with shades of grey, not even for the very first version for Trainz back in 2005. While that initial version did employ HOG for the final step, it made use of an extra and not well-known feature of HOG which bypassed any greyscale or color-band quantization. After that, TransDEM wrote Trainz .gnd files directly. In essence, TransDEM reads elevation values from the DEM data file, re-samples/converts them to fit the 10 or 5m terrain grid in Trainz, and places the z coordinate value of each baseboard ground vertex, without losing detail in the process. The re-sampling/conversion part deals with al the spatial coordinate system challenges. As already been mentioned, smoothing can and often should be applied, particularly for DEM file formats with integer values such as SRTM .hgt, certain .tif (including ASTER GDEM I think), plus .bil and a few others. It means, the DEM full full meter values only. Without smoothing such DEMs would produce noticeable terracing, artificial steps in the Trainz terrain, resembling rice paddies. However, higher resolutions DEMs (1/3 arc sec, 1/9 arc sec) are distributed in a floating point format anyway (like .img for USGS NED DEMs) and don't need additional smoothing. With the default settings, TransDEM should handle this automatically. (High res NED DEMs were available in .bil format at one time. Fortunately, this format has been retired.)

There was another utility program in the early days of Microsoft Train Simulator which had an extra option for Trainz. The program was called TSTF (Train Sim Terra Former) and it created Trainz displacement maps. Displacement maps were/are greyscale images and hereby limited to 255 different elevation levels.
 
John, that's only correct for the classic MicroDEM/HOG approach. TransDEM never did it with shades of grey, not even for the very first version for Trainz back in 2005. While that initial version did employ HOG for the final step, it made use of an extra and not well-known feature of HOG which bypassed any greyscale or color-band quantization. After that, TransDEM wrote Trainz .gnd files directly. In essence, TransDEM reads elevation values from the DEM data file, re-samples/converts them to fit the 10 or 5m terrain grid in Trainz, and places the z coordinate value of each baseboard ground vertex, without losing detail in the process. The re-sampling/conversion part deals with al the spatial coordinate system challenges. As already been mentioned, smoothing can and often should be applied, particularly for DEM file formats with integer values such as SRTM .hgt, certain .tif (including ASTER GDEM I think), plus .bil and a few others. It means, the DEM full full meter values only. Without smoothing such DEMs would produce noticeable terracing, artificial steps in the Trainz terrain, resembling rice paddies. However, higher resolutions DEMs (1/3 arc sec, 1/9 arc sec) are distributed in a floating point format anyway (like .img for USGS NED DEMs) and don't need additional smoothing. With the default settings, TransDEM should handle this automatically. (High res NED DEMs were available in .bil format at one time. Fortunately, this format has been retired.)

There was another utility program in the early days of Microsoft Train Simulator which had an extra option for Trainz. The program was called TSTF (Train Sim Terra Former) and it created Trainz displacement maps. Displacement maps were/are greyscale images and hereby limited to 255 different elevation levels.

Roland,

This is very interesting how TransDEM can write directly to the .gnd file and bypass the greyscale parts. Many other programs, including World Builder, World Construction Set, and others convert the DEM information to greyscale first before importing. World Builder, even with its procedural smoothing still produced steps which now I know couldn't be avoided due their data importing method.

John
 
Back
Top