DTI files derive their name from 'Digital Terrain Image Section.' In essence they are images suitable for mapping into a program's virtual memory space. Once mapped into memory the data may be treated as an array, and accessed rapidly by application programs. DTILIB provides routines to perform this memory mapping and basic i/o operations.
A DTI file consists of a header and data area. For most types of DTI file the header is of a fixed length (but see LSLA type file below), and the data area is of a variable length.
DTILIB provides two routines specifically to read the DTI header values. The first, DTI_READ_HEADER, reads the header record for all DTI files and puts the values into DTIHDR.CMN. The second, DTI_READ_PROJ_REC, reads the LSLA projection record if present, and puts any values into DTIPROJ.CMN. The presence of the projection record is indicated by HAD_PROJ_RECORD(DTILUN) in DTIHDR.CMN, with its details held in DTIPROJ.CMN.
5 different header structures may be distinguished, and identified by means of the header type identifier held in the first 4 bytes of the DTI file:
The following tables describe the length, offset and content of fields in the different DTI headers. The length and offset values are specified in bytes.
Field length Field offset Description
4 0 Header Type Identifier = UHL1
76 4 UHL Record
2 80 X Data Extent
2 82 Y Data Extent
4 84 X Grid Interval
4 88 Y Grid Interval
2 92 Minimum Byte or Word Data Value
2 94 Maximum Byte or Word Data Value
4 96 Minimum Long or Real Data Value
4 100 Maximum Long or Real Data Value
2 104 Data Type Identifier
150 106 Unused
256++ Data Area
Field length Field offset Description
4 0 Header Type Identifier = TED4
2 4 X Data Extent
2 6 Y Data Extent
4 8 X Grid Interval
4 12 Y Grid Interval
2 16 Minimum Byte or Word Data Value
2 18 Maximum Byte or Word Data Value
4 20 Minimum Long or Real Data Value
4 24 Maximum Long or Real Data Value
2 28 Data Type Identifier
206 30 Unused
648 236 DSI Record
2700 884 ACC record
3584++ Data Area
Field length Field offset Description
4 0 Header Type Identifier = MIKE
2 4 X Data Extent
2 6 Y Data Extent
4 8 X Grid Interval
4 12 Y Grid Interval
2 16 Minimum Byte or Word Data Value
2 18 Maximum Byte or Word Data Value
4 20 Minimum Long or Real Data Value
4 24 Maximum Long or Real Data Value
2 28 Data Type Identifier
226 30 Unused
256++ Data Area
Field length Field offset Description
4 0 Header Type Identifier = ALVY
2 4 X Data Extent
2 6 Y Data Extent
4 8 X Grid Interval
4 12 Y Grid Interval
2 16 Minimum Byte or Word Data Value
2 18 Maximum Byte or Word Data Value
4 20 Minimum Long or Real Data Value
4 24 Maximum Long or Real Data Value
2 28 Data Type Identifier
2 30 Unsigned Word Defining Start of
Data Area (ie. Length of Header)
Field length Field offset Description
4 0 Header Type Identifier = LSLA
2 4 X Data Extent
2 6 Y Data Extent
4 8 X Grid Interval
4 12 Y Grid Interval
2 16 Minimum Byte or Word Data Value
2 18 Maximum Byte or Word Data Value
4 20 Minimum Long or Real Data Value
4 24 Maximum Long or Real Data Value
1 28 Data Type Identifier
1 29 Data Order Values (Corner of
Origin and Direction)
2 30 Unsigned Word Defining Start of
Data Area (ie. Length of Header)
The first data value encountered in the data array is the south-west DTM value. The final data value is the north-east DTM value. Intervening data values are organised on a column basis, with the southernmost value of the column always being encountered first.
s(1,1),s(1,2)..., s(1,n), s(2,1),... ..., s(e,1), ..., s(e,n) where: 's' is the sample s(1,1)= SW corner of the grid 'n' is the north extent 'e' is the east extent _________________________ | | | | | 3 | 6 | 9 | | | | | ------------------------- | | | | | 2 | 5 | 8 | | | | | ------------------------- | | | | | 1 | 4 | 7 | | | | | -------------------------