Article Title: Importing DEMs in ARC Gridded ASCII format
Article Name: GENERAL12
OS Platforms: ALL
Last Updated: 04/14/2009

TOPIC:

DEMs in the ARC Gridded ASCII format can be imported by choosing Import DEM → ARC Gridded ASCII from the RiverTools File menu. This tip provides information on various keywords in the ARC "header lines" that are required in order to obtain a desired result.

DISCUSSION:

ARC Gridded ASCII files are plain text or ASCII files that begin with several "header lines" of georeferencing information followed by row after row of elevation values. The elevation values are in row-major order, so that the first value corresponds to the northwest corner of the DEM and the first row is the northernmost row. The georeferencing information contained in the header lines determine how RiverTools will read the data. These lines consist of key-value pairs, where the keys are standard ARC header keywords; the same ones that are used in ARC HDR files (with extension ".hdr").

If you are having difficulty importing an ARC Gridded ASCII file into RiverTools, it is most likely because of an incomplete or unrecognized set of key-value pairs in the header line section of the file. When a keyword is unrecognized, it is usually because ESRI has changed the set of potential values for a keyword or provides alternate keywords to provide the same or similar information. Several such changes occurred in the transition from Arc/Info to ArcView to ArcGIS.

A common problem is that Arc/Info used I and M for the two possible BYTEORDER values (abbreviations for Intel and Motorola), but ArcGIS uses the more descriptive strings LSBFIRST and MSBFIRST. Older versions of RiverTools only recognize the original I or M.

Another problem that can occur when importing a DEM in ARC Gridded ASCII format is that RiverTools imports it as a grid of 2-byte integers even though it contains floating-point elevation values. In this case the decimal part gets truncated and the resulting DEM contains only integer values. A shaded relief image of the resulting DEM will appear to have terraces instead of elevation values that vary smoothly. To prevent this, you need to set the NBITS keyword to 32 in the header section. RiverTools will then read the values as 4-byte floats.

It is good practice to provide the MAPUNITS and ZUNITS keywords in your ARC header lines, although these important pieces of information are often overlooked. RiverTools will issue a warning if either of these keywords is missing.

Here is a partial list of ARC header keywords:

NCOLS number of columns in the DEM
NROWS number of rows in the DEM
NBANDS number of bands
= 1 for DEMs, = 3 for RGB images
NBITS number of bits per data value
= 16 for 2-byte integers, = 32 for 4-byte floats
LAYOUT how the values are organized in an RGB image,
irrelevant for single-band data such as a DEM
= BIL (Byte-Interleaved by Line) or
= BIP (Byte-Interleaved by Pixel), etc.
CELLSIZE size of a grid cell
using this keyword implies same size in x and y
XDIM size of a grid cell in the x-direction (east-west)
YDIM size of a grid cell in the y-direction (north-south)
MAPUNITS units for XDIM and YDIM, but often missing,
or given in a separate PRJ file
= DEGREES or = METERS, for example
ZUNITS elevation units, but usually missing,
or given in a separate file
= METERS or = FEET, for example
BYTEORDER byte order (only relevant for binary files, e.g. BIL, FLT)
= I or LSBFIRST for Intel, M or MSBFIRST for Motorola.
NODATA value to use for nodata, often = -9999
NODATA_VALUE newer version of the NODATA keyword
ULXMAP center x-coordinate of grid cell in upper-left corner
ULYMAP center y-coordinate of grid cell in upper-left corner
XLLCORNER left-edge x-coordinate of grid cell in lower-left corner
YLLCORNER bottom y-coordinate of grid cell in lower-left corner
XLLCENTER center x-coordinate of grid cell in lower-left corner
YLLCENTER center y-coordinate of grid cell in lower-left corner
BANDROWBYTES number of bytes in one row of data
TOTALROWBYTES number of bytes in one row of data (for multi-band)
SKIPBYTES number of header bytes before data starts in binary file

An ARC Gridded ASCII file may also be accompanied by a world file and/or a projection file. These contain additional and often redundant georeferencing information, such as grid cell dimensions and bounding box information. World files associated with another file often have a 3-letter extension that is formed from the first and last letters of the file's extension, followed by the letter "W". Examples of such pairs are ".DEM" and ".DMW", ".BIL" and ".BLW", and ".TIF" and ".TFW". Projection files have the extension ".PRJ" and contain information about the map projection, if any.


If you have any additional questions or comments, please contact Rivix Technical Support for assistance.

Copyright (C) RIVIX, LLC. 1998-2016