Data Structure for SoftWright 30-meter Elevation Files

 

The SoftWright 30-meter elevation data files are produced from the USGS 7-1/2 minute DEM files. The original format and content of these files are described in National Mapping Program Technical Instructions, Data Users Guide 5, "Digital Elevation Models". Like the USGS files, the SoftWright files are supplied in units of one 7-1/2 minute topo map, or "quad", per file.

File Names

The SoftWright file naming convention for 30-meter elevation data files is as follows:

CwwwnnNW.DTA

where:

C is the file name prefix indicating 30-meter data (for purposes of comparison, 30-second data file names have the prefix "A", and 3-second file names have the prefix "B").

www is the three digit western longitude degree value, including leading zeroes, for the southeast corner of the degree block containing the quad. Eastern longitudes are indicated by values greater than 180°. For example, longitude 170E would be indicated by the value 190 in the file name.

nn is the two digit northern latitude degree value, including leading zeroes, for the southeast corner of the degree block containing the quad. Quad files for southern latitudes are indicated in the file name suffix as described below.

N is the single letter designator of the quad latitude location in the degree block. The naming convention for northern latitude blocks follows the USGS format for map names, using the letters A-H to indicate the band of latitude above the bottom of the degree block:

A 0' to 7-1/2' E 30' to 37-1/2'
B 7-1/2' to 15' F 37-1/2' to 45'
C 15' to 22-1/2' G 45' to 52-1/2'
D 22-1/2' to 30' H 52-1/2' to 60'

Quads in the southern latitudes are indicated by the use of the letters I-P to indicate the band of latitude above the bottom of the degree block:

I 0' to 7-1/2' M 30' to 37-1/2'
J 7-1/2' to 15' N 37-1/2' to 45'
K 15' to 22-1/2' O 45' to 52-1/2'
L 22-1/2' to 30' P 52-1/2' to 60'

W is the single number designator of the quad longitude location in the degree block. The naming convention for all blocks follows the USGS format for map names, using the numbers 1-8 to indicate the band of longitude west of the right (eastern) edge of the degree block:

1 0' to 7-1/2' 5 30' to 37-1/2'
2 7-1/2' to 15' 6 37-1/2' to 45'
3 15' to 22-1/2' 7 45' to 52-1/2'
4 22-1/2' to 30' 8 52-1/2' to 60'

This naming convention is illustrated by the following excerpt from the USGS Index to Topographic and Other Map Coverage for Colorado:

format2.gif (39278 bytes)

File Structure

The SoftWright 30-meter elevation data files are binary files using a fixed record length in each file, but the record length varies between different files. Each record in the file consist of a column of points (from south to north) along a line of constant easting. The records are arranged in the file in order of increasing easting. In other words, after the header record described below, the first data record in the file is the south to north column eastern-most points in the file, and the last record is the south to north column of western-most points in the file.

The USGS 7-1/2' DEMs are based on the Universal Transverse Mercator (UTM) coordinate system for the locations of grid points instead of a latitude/longitude grid, and the SoftWright file structure maintains this convention. Since the UTM grid system is not orthogonal to the latitude-longitude system that defines the boundaries of the quad (or map), certain allowances must be made for the number of 30-meter data points along each north-south profile in the file. For example, as shown in Figure 1 from the USGS Data Users Guide 5, columns of data near the edges of the quad may be partially outside of the vertical boundaries of the quad (defined by lines of longitude), and only the points within the quad boundaries are included in the file.

For this reason, the first record in each SoftWright 30-meter elevation data file is a header record containing information about the structure of that particular file. This header information consists of the following information:

 

Bytes

 

Data type

 

Description

USGS Data Item

1-2

none reserved N/A

3-4

2-byte integer Record length for the file (in bytes) N/A

5-6

2-byte integer Number of columns of data in the file (south to north profiles) A-16

7-8

2-byte integer Number of rows of data in the file (west to east data values) N/A

9-12

4-byte integer Minimum northing in the file (in meters) A-11

13-16

4-byte integer Maximum northing in the file (in meters) A-11

17-20

4-byte integer Minimum easting in the file (in meters) A-11

21-24

4-byte integer Maximum easting in the file (in meters) A-11

25-64

ASCII Name and/or description of USGS quad map. A-1

65-75

ASCII Datum (NAD-27, WGS-72, NAD-83, etc.) A-27

76

ASCII DEM level (1,2,3) A-3

77-78

2-byte integer Minimum elevation in file (in meters) A-12

79-80

2-byte integer Maximum elevation in file (in meters) A-12

81-120

ASCII Data Source (e.g., "SoftWright, Aurora CO") N/A

121-122

2-byte integer UTM zone number (±1-60) A-6

123-124

2-byte integer Spatial resolution (in meters) - x (10,20,30 or 0 = 30) A-15

125-126

2-byte integer Spatial resolution (in meters) - y (10,20,30 or 0 = 30) A-15

127-128

2-byte integer Spatial resolution (in meters) - z (1 or 0=1)

129-200

none reserved N/A

201-220

none reserved for internal use N/A

221-n

none reserved (n is record length from bytes 3-4 above) N/A

n+1-eof

2-byte integer elevation data values B-6

Table 1: 30-meter Data Format

Typically, the file header record should be read first to determine the record length of the file. All records in the file (including the header record) are of uniform length as indicated by bytes 3-4 of the header record. The header record also contains other information necessary for proper operation with the TAP system. No changes should be made to the header record of the file.

The record length given in the header record defines the constant length of the records in the file. In succeeding each record, the first four bytes contain a 4-byte integer that defines the easting of all points on that profile (or south to north column of data defined by that record). Bytes 5-8 contain a 4-byte integer that defines the northing of the first point on the profile. (The northing of each successive point on the profile is obtained by adding 30 meters to the northing of the previous point on the profile.) The 2-byte integer elevation values (in meters) begin with bytes 9-10 of each record.

Bytes 25-64 (40 characters) contain the USGS quad name and/or description from the file. Since this is an ASCII field, the name of the quad is usually recognizable even though most of the rest of the content of the binary data in the file is not. Bytes 65-75 (11 characters) contain the geodetic datum used for the coordinate locations in the file. Byte 76 is a single ASCII character indicating the DEM level (1-3) assigned to the file by the USGS. The value indicates the USGS "level of quality" of the data in the file. A complete description of the DEM level classifications is found in the "Digital Elevation Model Data User’s Guide 5", available from the USGS.

Beginning in February of 1995, bytes 77-78 contain a two-byte integer value of the minimum elevation in the file, and bytes 79-80 contain the maximum elevation in the file, both values in meters. Bytes 81-120 (40 characters) contain an ASCII string indicating the source of the data conversion from the USGS DEM files to this format.

Beginning February of 1995, bytes 121-122 contain the UTM zone value.

Beginning June of 1995, bytes 123-128 contain the x,y and z spatial resolution. The default values (if the file contains zeroes in these bytes) are 30,30,1.

Bytes 201-220 (20 bytes) are reserved for internal use by the software.

Note the process of fitting elevation points on a UTM grid into a rectangle defined by geographic coordinates causes the skewing effect illustrated on page 3 of this document. As a result, profiles in the file do not all have the same number of elevation points, nor do they all necessarily have the same northing for the starting point of the radial. For example, profiles near the east and west edges of the quad may "clip the corner" of the quad, resulting in only a few points on that profile in the quad. In the original USGS ASCII DEM format this is accomplished by using variable length records. However, since the SoftWright format requires all profile records to be of uniform length, records with fewer than the maximum number of points are "padded" with the value -32000. It should be noted that the northing value for each profile record in the SoftWright file (defined by bytes 5-8 of each record) defines the northing of the first actual data point on the profile, not necessarily the first point in the record if that first point is a "padding" value (-32000).

 

.