Grid Exchange .GXF File Description


The Grid Exchange filter imports and exports elevation data in Grid Exchange .GXF file format.


File Description

The Grid eXchange File .GXF is an open standard ASCII file format for exchanging gridded data among different software systems. Software that supports the .GXF standard will be able to import properly formatted .GXF files and export grids in .GXF format.


File Format

A GXF file is an ASCII file made up of a number of labeled data objects and comments. Each labeled data object has a label line followed by one or more data lines. A label line is identified by a '#' character in the first column followed immediately by an upper-case label. The data associated with that label are found on one or more lines that follow that label.


Any lines that are not part of a labeled data object are ignored and can be used to place comments with a .GXF file. Programs that read .GXF files ignore such comment lines while searching for the next GXF data object.


All lines in a .GXF file must be less than or equal to 80 characters in length. If the last non-white space character on a line is a '\', the next line is assumed to be a continuation of the current line (except for #GRID data lines). Spaces and tab characters are white space characters. Note that continuation lines are a feature of GXF revision 3, and they should only be required for defining projection parameters that require more than 80 characters. They are not required and cannot be used for writing grid data to the GXF (in the #GRID object). This allows GSF readers written for GXF revision 2 and earlier to read GXF revision 3 files.


Any name or string parameters that are part of a data object and which themselves contain spaces, must be enclosed in double quotes. Parameters on data lines may be separated by a space or comma.


For example, the following file satisfies this format:


This is a very small 4 x 5 point grid.







These lines are skipped because they are not part of a data object.



135.28    122.21    119.64    163.25    199.15

145.38    132.45    120.32    121.42    205.18

140.13    151.48    132.91    119.12    219.67

132.67    150.56    140.45    102.89    218.41


This file contains two comment lines at the beginning, followed by two labeled data objects, another comment, and finally a #GRID data object. The #GRID object is always the last object and indicates the beginning of the gridded data. This example contains the minimum information required to define a grid, and other grid information, such as location, storage, sense, sampling separations, etc, assume default values. The next section documents all data objects defined in this revision. The only required data objects are #POINTS, #ROWS, and #GRID. All other GXF objects will assume default value. However, a recommended minimum set of defined data objects would also include #PTSEPARATION, #RWSEPARATION, #XORIGIN, and #YORIGIN, since these objects serve to define the minimum amount of information needed to locate the grid in an assumed coordinate system.


File Name Extensions



Import Method

Choose the File | Import command.


Import Options

Specify import options in the Lattice Import Options dialog.


Export Method

Select a lattice or image module and choose the File | Save Data command.


Export Options

Specify export options in the Grid Exchange .GXF Export Options dialog.





See Also

File Format Chart

Grid Exchange .GXF Export Options Dialog