Table of Contents

Common HF2/HFZ extended header blocks

Georeferencing

georef-extents

The “georef-extents” block describes the real-world extents of the file. It is largely copied from the georeferencing data in the VTP Binary Terrain file header. The block contains 58 bytes, the structure of which is described below:

Name Offset Length Type Description
Block type 0 4 string “bin”.
Block name 4 16 string “georef-extents” (padded with zeros).
Block length 20 4 DWORD 34 (bytes following block length).
Extent units 24 2 short int 0 = degrees, 1 = metres, 2 = feet (imperial), 3 = feet (U.S. survey)
Left extent 26 8 double
Right extent 34 8 double
Bottom extent 42 8 double
Top extent 50 8 double

georef-utm

The “georef-utm” block identifies the real-world UTM zone of the file. Please refer to the VTP Binary Terrain file header for more info. The block contains 26 bytes, the structure of which is described below:

Name Offset Length Type Description
Block type 0 4 string “bin”.
Block name 4 16 string “georef-utm” (padded with zeros).
Block length 20 4 DWORD 2 (bytes following block length).
UTM zone code 24 2 short int

georef-datum

The “georef-datum” block identifies the EPSG datum code of the file. Please refer to the VTP Binary Terrain file header for more info. The block contains 26 bytes, the structure of which is described below:

Name Offset Length Type Description
Block type 0 4 string “bin”.
Block name 4 16 string “georef-datum” (padded with zeros).
Block length 20 4 DWORD 2 (bytes following block length).
EPSG datum code 24 2 short int

georef-epsg-prj

The “georef-epsg-prj” block identifies the EPSG projection code of the file. The block contains 26 bytes, the structure of which is described below:

Name Offset Length Type Description
Block type 0 4 string “bin”.
Block name 4 16 string “georef-epsg-prj” (padded with zeros).
Block length 20 4 DWORD 2 (bytes following block length).
EPSG proj. code 24 2 short int

Miscellaneous data

app-name

The “app-name” block identifies the application that saved the HF2/HFZ file. The block has a variable length.

Name Offset Length Type Description
Block type 0 4 string “txt”.
Block name 4 16 string “app-name” (padded with zeros).
Block length 20 4 DWORD variable (depends on following string length).
Application name 24 variable string Null-terminated string containing application name, e.g. “Terragen 2”, “L3DT”, etc.

precis-rel

The “precis-rel” block identifies that the vertical precision of the file, if re-saved, should be calculated from the product of the horizontal scale of the map (in metres) and the relative precision factor given in the block body. The block contains 28 bytes, the structure of which is described below:

Name Offset Length Type Description
Block type 0 4 string “bin”.
Block name 4 16 string “precis-rel” (padded with zeros).
Block length 20 4 DWORD 2 (bytes following block length).
Relative precision 24 4 float

Typically in L3DT the relative precision is set to 0.001, which means that when the map is saved, the vertical precision used in the HF2 compression is 0.001 times the horizontal scale (vertex spacing) of the map. This scheme ensures that the precision of the height data scales appropriately with the scale of the terrain.