Grid Format Information Page
The grid files containing digital terrain models are served in two formats. Both formats are
self-describing and machine independent.
.CDF
The .cdf format has been created by Wessel and Smith(1991) for the
GMT set of public domain programs. This format uses the NetCDF library of
the National Center for Atomspheric Research (NCAR). The file can be read
with GMT utilities such as grdedit, or grdinfo. It is a two
dimensional binary file. It has a 1468 byte header containing a descriptive title,
any additional comments, units of the x, y, z, dimensions, number of nodes in the x, y dimensions,
minimum and maximum values of x, y, z, node spacing in the x, y directions,
a scale factor, and offset. The grid array is IEEE 32-bit floating point numbers,
consisting of sequential rows from top to bottom. Each row contains values from left to right.
.HDF
The .hdf format uses the HDF library of National Center for Supercomputing Applications (NCSA).
It consists of three arrays containing:- the depths for each grid node (32-bit IEEE floating point numbers),
- an image of the grid (8-bit unsigned characters),
- a color palette.
Selection of HDF INFO
will display the grid dimensions and attributes, and will show the image with its color palette.
It can be read directly with public domain programs provided by NCSA, including hdfed, and
Collage, XImage, and the commercially available program Spyglass Transform. To obtain Spyglass Transform contact:
Spyglass Inc.
701 Devonshire Drive, C-17
Champaign, IL
61820
Telephone: (217) 555-165
Fax:(217)555-8925.
Transform, Collage and XImage are available for Unix platforms, the Macintosh, and the IBM-compatible PC running
Microsoft Windows.
click here to view example source code
to read an .hdf file containing digital terrain model grids.