The GRD (grid) file
stores the estimate of the sub-pixel location of the center of every
feature in an array.
The format of the GRD file is a binary file with data stored in
big-endian format.
The file consists of the following sections (in order)
The file header consists of 36 bytes in total. The values are:
| Item |
Description | Type |
Size | | 1 |
Magic number used to identify the file:
(octal) 211 107 122 104 015 012 032 012 (hexadecimal) 89 47 52 44 0d 0a 1a 0a (ASCII C notation) \211 G R D \r \n \032 \n
|
char[8] | 8 byte |
| 2 | The version
number of the file. The version number is set to 1. |
float |
4 bytes |
| 3 | The number of
features in the x direction (Nx). | unsigned
int |
4 bytes |
| 4 | The number of
features in the y direction (Ny). | unsigned
int |
4 bytes |
| 5 | The
x-direction feature pitch. | float |
4 bytes |
| 6 | The
y-direction feature pitch. | float |
4 bytes |
| 7 | The
x-direction feature setback. |
float |
4 bytes |
| 8 | The
y-direction feature setback. |
float |
4 bytes |
This section contains parameters stored as name/value pairs.
| Item |
Description | Type |
Size | | 1 |
Total number of bytes in the tag-based header. |
unsigned int | 4
bytes |
| 2 | Total number
of name-value pairs in the tag-based header. |
unsigned int |
4 bytes |
| 3 | A series of
ASCII strings in a name-value pair format. For each name-value pair we have
the following 4 entries:
- String length of name including the null terminating character,
unsigned integer (4 bytes)
- A null terminated array of ASCII characters with length as specified
above.
- String length of value including the null terminating character,
unsigned integer (4 bytes)
- A null terminated array of ASCII characters with length as specified
above.
| see description |
see description |
Note: The following tags shall be included in version 1 of the
format:
- "Parent DAT File" - the full name of the DAT file associated with
this GRD.
- "Scan Date Time" - the date and time of the scan from the DAT
file.
- "Scanner ID" - scanner ID from the DAT file.
The optimized sub-grid corner location section shall contain the
corner coordinates of each subgrid as computed during the DAT file
analysis. Note: not all DAT file analyses in GCOS will product a GRD
file.
| Item |
Description | Type |
Size | | 1 |
Total number of bytes in this section. |
unsigned int | 4
bytes |
| 2 | Total number
of subgrids in this section. |
unsigned int |
4 bytes |
| 3 | For each
sub-grid the following coordinates are stored:
- upper left x, float (4 bytes)
- upper left y, float (4 bytes)
- upper right x, float (4 bytes)
- upper right y, float (4 bytes)
- lower left x, float (4 bytes)
- lower left y, float (4 bytes)
- lower right x, float (4 bytes)
- lower right y, float (4 bytes)
| Array of floats |
#sub-grids * 32 bytes |
The feature center data block consists of Nx * Ny pairs of (x,y)
coordinates. Every feature on the array is contains an associated (x,y)
feature center.
| Item |
Description | Type |
Size | | 1 |
The first sub-pixel coordinate pair stored is
for the feature at cell-coordinate (0,0). |
float, float | 8 byte |
| 2 | The first
sub-pixel coordinate pair stored is for the feature at cell-coordinate
(1,0). |
float, float |
8 bytes |
| 3 | The first
sub-pixel coordinate pair stored is for the feature at cell-coordinate
(2,0). | float, float |
8 bytes |
| 4 | ... | |
|
|