Gridfiles

Gridfiles were designed as a simple non-proprietary format for use in GIS applications. They are particularly useful for applications based on ESRI's MapObjects library.

A gridfile consists of 2 files: *.GRD and *.GRI

To visualize a gridfile in a MapObjects application, such as DIVA-GIS, a *.BMP and *.BMPW file are derived from the *.GRD and *.GRD files. It is the *.BMP file that is used to draw a map, while the *.GRI file that is used as database.

The *.GRI file contains the actual data. It is a binary file (integer or real values) in which the values of a grid are sequentially stored (row by row, from left to right, starting in the upper-left corner)

The *.GRD file contains the information needed to geo-reference the data, about the legend, and some other things. It is a database file in text format, following the format of MS-Windows "ini" files. There are four main headings: [general], [georeference], [data], and [legend]. Within these headings a number of keywords have been defined (see below). Additional headings can be added, for example for a specific application (= "[General].creator" ).

Example of the contents of a *.GRD file:

[General]
Version= 1.0
Creator= Diva
Title=n_observat_wp
Created=20010203

[GeoReference]
Projection=unknown
Columns=66
Rows=84
MinX=-115
MaxX=-49
MinY=-44
MaxY=40
ResolutionX=1
ResolutionY=1

[Data]
DataType=integer
MinValue=1
MaxValue=247
NoDataValue=-9999
Transparent=1

[Legend]
NoDataColor=15329769
NoDataLabel=Nodata
Count=5
Color1=25600
Min1=1
Max1=50
Label1=1 - 50
Color2=64000
Min2=50
Max2=99
Label2=50 - 99
Color3=65535
Min3=99
Max3=149
Label3=99 - 149
Color4=38655
Min4=149
Max4=198
Label4=149 - 198
Color5=255
Min5=198
Max5=247
Label5=198 - 247

[Diva]
TypeSource=File created with : DIVA 1.3, pre-release
FileSource=e:\traits\wild_traits2.shp
NameProcedure=Number of observations
FieldProcedure=
CountValuesProcedure=0
NameMethod=Simple
FileMask=
TypeMask=