This page will look better in a browser that supports web standards and has style sheets enabled.

MacDEM can import several kinds of digital elevation model files:

USGS ASCII (also called "native") files are plain text files but tend to be very large.

SDTS (Spatial Data Transfer Standard) files store the elevation data in binary form making them smaller than ASCII files. However, they store the DEM meta-data (information about the DEM) in several separate files, making them less convenient to work with. Each SDTS "transfer" (group of files for one DEM) must be placed in its own directory to avoid file name conflicts with other transfers.

NOTE: There is a known problem with the georeferencing data in SDTS files created before Jan 2001. The nature of the error is such that it should always be less than one grid cell (typically 30 meters). This error could cause gaps when merging these files. MacDEM attempts to correct this error to allow merged DEMs to match at their edges with no gap. This correction seems to work most of the time. MacDEM does not apply the correction to newer SDTS files since they don't have the error.

Some tips on handling DEM files downloaded from the USGS:

DTED, GLOBE, GTOPO30, and TerrainBase files store the elevation data in binary form. Note that GTOPO30 and TerrainBase DEMs have two files. GTOPO30 DEMs consist of a *.dem and a *.hdr file. TerrainBase DEMs consist of a *.bin and a *.hdr file.

MacDEM saves DEM files in its own compressed binary format. These files are roughly 5%-10% the size of ASCII files and 25% the size of binary files, and they load faster too. Not all meta-data is saved, however the most important georeferencing data is.

DEM files can contain a large amount of data, and drawing a shaded DEM is computationally intensive. Loading and displaying DEMs can be quite time consuming on older computers. Patience is a virtue. When it is lacking, press command-period. This halts many operations in MacDEM.

PGM File Format

PGM files are ASCII text files in the form:

e11 e12 e13 ... e1m
e21 e22 e23 ... ...
... ... ... ... ...
en1 en2 en3 ... enm

"P2" - identifies the file as an ASCII PGM file.
m - is the number of columns
n - is the number of rows
max_gray_value - is the largest value in the data. See below for how this is used.
eij - is an elevation value represented as an ASCII integer. Even though PGM files normally should not have negative numbers, MacDEM will accept them.

If max_gray_value is > 32767, MacDEM will rescale the elevation data by (32767.0/max_gray_value) so the data will fit in 16-bit integers. In this case max_gray_value must be greater than or equal to the largest elevation value.

If max_gray_value is <=32767, MacDEM will not rescale the elevation data, preserving the original values read from the file. In this case the elevation values eij must be in the range +/-32767. MacDEM will compute what the actual max value is. That way you don't have to manually determine the correct max value. (Thus, any max_gray_value from 0 to 32767 will yield the same result).

MacDEM allows each line of the PGM file to be longer than the normal limit of 70 characters. You can make the lines as long as you'd like.

Note: There presently is no way for you to enter any scaling information for the PGM. The data is placed in UTM zone 0 at the equator. MacDEM defaults the data to a 30m grid, with elevation units of feet. The use of PGM files as a means of reading in raw data has been superseded by the Import Raw Data menu item. But if you already have data in a PGM format, you could either:
1) use Import PGM to read it into MacDEM, then export it to binary, then use Import Raw data to re-import the binary data and scale it.
2) use Import Raw Data in ASCII mode to import the PGM, specifying the proper number of bytes to skip over the PGM header, size, and max_gray characters.