Elevation
Models
Summary: This Lightwave [6] plugin provides 4 Image File Loaders for GTOPO30, PDS3 (MOLA), MicroDEM, and STM digital elevation models. Topographical data stored in these formats can be loaded into the Lightwave Image Editor as grayscale floating point images. Normally these images will be used as bump maps, displacement maps (just like the SDTS displacement maps described in Gregory Duquesne's Creating a Landscape tutorial), or in the TextureScape Modeler Tool plugin.
Load any of these digital elevation models using any of the image loading techniques available in LightWave (in the Image Editor or the Texture Editor's image layer, in the Objects's Item Properties' Displacement Map panel, etc.) When the file requester appears, you will probably need to change the "Files of type" pull-down menu to read "All Files". Then choose the appropriate digital elevation model file specified in each of the file formats' section below.
Once
Lightwave has loaded the data, a requester will appear displaying the
minimum and maximum elevation found in the file. This information can
be used to determine the best values for displaying the grayscale image
in Lightwave's Image Editor and the image thumbnail views.
If only one dataset is going to be loaded, the default values displayed in the Image's black point elevation and Image's white point elevation requester fields will be the correct settings for the best image display possible. In addition, if the dataset contains invalid height values (usually around the outside border of the quadrangle), the user is informed of this, and is allowed to choose the height value that will be used anytime an invalid elevation is encountered.
If you load multiple, independent datasets into Lightwave, the plugin will remember and display the previous black point and white point elevations in the user requester (why it does this is explained in the following paragraphs). However, since these datasets will be independent of each other, you can quickly change the values to the current file's Minimum and Maximum values by pressing the Reset button. This will allow the Image Editor to display each file in the best possible manner.
If you would like to load multiple, neighboring datasets in an attempt to tile them into a larger landscape, things are a little trickier. The image loader transforms the height data into a 0...1 range, so that it can be displayed correctly in LightWave's Image Editor. The user must ensure that the transformation is being done consistently for each dataset that is to be loaded. This transformation is controlled by using the black point and white point requestors and will probably require that several of the datasets will have to be read in a second time.
The correct black point and white point should be the minimum and maximum value found in all of the datasets that are going to be loaded. The loader will assist in keeping track of the overall minimum and maximum, because it will remember the min and max values from the previous datasets that were loaded.
So load the first dataset, and just accept the default values. Now load the second dataset, and if the minimum elevation in the new file is less than the current black point, then change the black point value to reflect the new minimum. If the maximum elevation is greater than the white point value, then change the white point to reflect the new maximum. Repeat this step again until all of the datasets have been loaded.
Now to insure that all the datasets are transformed to 0...1 range consistently, use the Image Editor's Replace Image button to reload all of the previously loaded files again. The black point and white point values will be retained, so the user will now just need to accept the default values in those requestor fields, and all of the data will have been transformed consistently and correctly into the displayable 0...1 range necessary for display in the Image Editor.
If correct display of the images is not important, the most important thing to remember is to transform all the data into the image's display range consistently by using the same white point and black point values for every dataset. If you don't use the overall minimum and maximum, the data will still be transformed correctly and consistently, but the images will just not be displayed optimally in the Image Editor.
This format was created by Michael Garland for his Scape Terrain Simplification software. It was one of the formats that the DEMScape plugin could read, and the Daylon Leveller heightfield modeller also provides input and output support for STM. It is an easy format to read and write, so it is very useful if you want to create your own datasets. For example, here are several programs that have been written to convert various types of digital elevation data into STM format.
vdem2stm: Ernie Wright has written a Vistapro DEM to STM converter for both Intel and Amiga platforms. You can get vdem2stm.zip (Intel) or vdem2stm.lha (Amiga), convert the Vistapro binary DEM to STM. Thanks Ernie!!
img2stm: Although the PDS3 (MOLA) image loader plugin will read this data, this DOS command line program offers the ability to crop a rectangular area from the data before converting it to STM. Since the MOLA data is available in very high resolution datasets, this option might work best for users with smaller amounts of memory in their computer. Instructions on how to use the program and the source code are included in the img2stm.zip file.
gtopo2stm: The GTOPO30 image loader plugin will also read this data, but this DOS command line program offers the ability to crop a rectangular area from the data before converting it to STM. Since the GTOPO30 data is available in fairly high resolution datasets, this option might work best for users with smaller amounts of memory in their computer. Instructions on how to use the program and the source code are included in the gtopo2stm.zip file.
MicroDEM is a microcomputer mapping program written by Professor Peter Guth of the Oceanography Department, U.S. Naval Academy. He has also created an inexpensive shareware program called DEMConverter that will read and write a wide variety of DEM formats, as well perform some DEM file manipulations such as merge, thin, and subset. This MicroDEM Image File Loader is intended to work with the MicroDEM binary output saved from either MicroDEM or from DEMConverter.
Robert Thompson assisted a Lightwave Mailing List member with using the GTOPO30 data at the USGS EROS Data Center. His message is an excellent example of how to use MicroDEM to convert the data into a format that this plugin can read. Thanks to Robert for the following information!
1) Open MicroDEM and go to Options. We'll set some preferences here.
a. Map tab. Uncheck Marginal information, then
go to Grid and set it to Neither. Save.
b. Units tab. Check Locations as Lat/Long and
Lat/Long as decimal degrees. Save.
c. Views tab. Set, if it isn't already,
Missing values to sea level. Save.
2) Close and reopen MicroDEM.
a. Go to File/Data Manipulation/ImportGTOPO30.
(You'll get a device not ready, just cancel. This is set for a CD that
can be obtained.)
b. Navigate to where you have the decompressed
GTOPO30 and select the header file.
c. Now you'll have to enter the NW lat/lon and
the SE lat/lon.
d. Save the dem.
GTOPO30 is a global digital elevation model with a horizontal grid spacing of 30 arc seconds (approximately 1 kilometer). The USGS EROS Data Center provides freely downloadable GTOPO30 data with coverage for the entire world.
The data is provided in .tar.gz format, and each archive contains 8 different files. To use the GTOPO30 Image Loader Plugin, you will need to gunzip and untar the archive. When you use the Lightwave Load Image button, you should select the .HDR file extracted from the archive. The plugin will read some necessary information from that file, and then proceed to load the actual height data from the .DEM file. Those are the only 2 files from the archive needed by the plugin, the other files can be discarded if you need the disk space.
Remember, most of the tiles from this site (all but the Antarctic data, and it's fairly large as well) have a resolution of 4,800 x 6,000. Since this data is loaded into Lightwave's grayscale floating point image format, each data point requires 4 bytes, therefore each image will require approximately 115 MBytes of memory. If using this amount of memory might cause problems, you might want to try converting the data into smaller STM or MicroDEM files using the techniques described in the previous 2 sections.
The GTOPO30 image reader can also handle the files from the Global Land One-km Base Elevation (GLOBE) Project. This site has 16bit raster data in tiles that are larger than those at the GTOPO30 site, but one of the features at this site gives you the option to interactively choose which portion of the data you would like to download. Here are the necessary instructions to follow if you want to read the GLOBE data using the ElevationModel plugin.
If you grab an entire tile, first decompress the downloaded .gz file (with gunzip, Winzip, or any other program that handles gzipped files), then rename the uncompressed file with a .dem extension. Now from the same page that you downloaded the DEM tile, click on the link labelled "Get header and/or color files for some applications", then choose and save the appropriate esri .hdr file for the tile you downloaded.
Now when you choose Load Image in Lightwave, just choose the .hdr file in the file requester. If you renamed the downloaded data with a .dem extension as mentioned above, the Model Elevations plugin will read the necessary info from the .hdr file, and then proceed to load the elevation data from the .dem file. But remember, these tiles are HUGE... they will require LOTS of memory in Lightwave, and take a fair amount of time to load. The tiles along the North and South Poles will require approximately 208 MB as an image in Lightwave, and the tiles along the equator will require approximately 260 MB.
So an alternative is to use the GLOBE's web page that allows you to choose only a portion of the data. You have the option to do text entry of specific latitudes and longitudes, or you can choose to use a map-based java applet to interactively choose a rectangular area. The only thing you need to change on the lower portion of that page is the pull-down menu labelled "Export type:". Choose the ESRI ArcView option from that menu, and the other menus can remain with their default values (Data type: must be int16, and File format: should work with any of the **binary** options). Once you click on the "Get Data" button, the area you selected will be processed and made available for download.
You will need to download the resulting .bil file and the .hdr file. Rename the .bil file to a .dem file. And once again when you Load Image in Lightwave, just choose the .hdr file in the file requester. Don't forget to change the .bil extension to .dem, or the Elevation Models plugin won't be able to locate the elevation data. Remember, these images are loaded into Lightwave as 4 byte floating point grayscale images, so they will require twice as memory as they take up on disk (where they are stored as 2 byte shorts).
MOLA (the Mars Orbiter Laser Altimeter) is an instrument currently in orbit around Mars on the Mars Global Surveyor spacecraft. Four different resolutions (from .25 degrees/pixel to .031 degrees/pixel) of MOLA data in PDS format can be downloaded from the web (download both the .IMG topography data file and the corresponding .LBL PDS label file).
When you use the Lightwave Load Image button, you should select the .LBL file downloaded from the web site. The plugin will read some necessary information from that file, and then proceed to load the actual height data from the .IMG file.
Remember, the data you download from this site is high to very high resolution. Since this data is loaded into Lightwave's grayscale floating point image format, each data point requires 4 bytes, therefore each image will require approximately twice the amount of memory listed on the web page for each IMG file (in which each data point is stored as a 2 byte short). For example, the IEG025T.IMG file is 2 MB, but it will require 4 MB of memory in Lightwave. The IEG0031T.IMG file will require almost 260 MBytes of memory in Lightwave. If using this amount of memory might cause problems, you might want to try converting the data into smaller STM files using the img2stm program described above in the STM Files section.
Intel Executable: ElevationModels.zip
Intel x64 Executable: ElevationModels_x64.zip
Mac OS9 Executable: ElevationModelsOS9.zip
Mac OSX Executable: ElevationModelsOSX.zip
Thanks very much to Richard Brak
for providing both of the Mac compiles of ElevationModels.
Mac OS9 Notes (and might also be relevant to OSX, but I haven't heard any reports yet from OSX users): Because of the way image loaders work, this plugin will not function correctly unless the qttools.p plugin is disabled first. So temporarily, go to the Edit Plugins panel, and at the bottom of the panel choose the File button for the Grouping Method. Now locate the qttools.p plugin and Delete it from the database. Now try loading any of the DEM files supported by this plugin, and the ElevationModels plugin should get its chance to load the data and will display the black and white points requester shown above. Once you've loaded the DEM files, you may re-add the qttools.p plugin to the database again.
If you are interested in why this problem occurs, here is a description of the way image loader plugins work in Lightwave. The "first" image loader gets it shot at reading the data, and if it doesn't recognize the file format, it is supposed to return an "unrecognized" return code, so the next image loader plugin can try to load the data. This goes on until one image loader can read the data, or until all the image loaders have had their shot at reading the data, whichever comes first. Unfortunately the qttools.p plugin on the Mac thinks it can read just about anything, so it tries to read the data and then never returns the "unrecognized" code, so the rest of the image loaders (including ElevationModels.p) never get their shot at reading the data. You will never see the black and white points requester for this plugin if you do not disable the qttools.p plugin first. This same problem prevents the SDTS plugin that is included with LW[6] and LW[7] from working correctly as well. So if you have tried unsuccessfully to use that image loader plugin, disabling the qttools.p plugin should also solve that plugin's inability to perform correctly.
One more Mac note... currently I don't believe this version of the Mac plugin is reading MicroDEM files correctly. It is not a major problem, since MicroDEM is a Windows only application, and MicroDEM files are generally not available to Mac owners. But you should be aware of this problem if you have access to MicroDEM files created with a Windows machine. The other 3 DEM formats supported by this plugin are reportedly working correctly.
Source Code: I will gladly give the
source code for this plugin to anyone interested.
Just send me some e-mail (marvinl AT email.arizona.edu) and ask.