Esri grid: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎ASCII: added image
→‎ASCII: reword, add spaces
Line 39: Line 39:
| style="vertical-align: top;" |
| style="vertical-align: top;" |
<pre>
<pre>
ncols 4
ncols 4
nrows 6
nrows 6
xllcorner 0.0
xllcorner 0.0
yllcorner 0.0
yllcorner 0.0
cellsize 100
cellsize 100.0
nodata_value -9999.0
NODATA_value -9999.0
5.5 -12.3 12.0 -8.5
5.5 -12.3 12.0 -8.5
-9999.0 -6.2 -8.1 -5.3
-9999.0 -6.2 -8.1 -5.3
Line 55: Line 55:


where
where
:''<tt>ncols</tt>'' is the number of rows (an [[integer]]);
*''<code>ncols</code>'' and ''<code>nrows</code>'' are the the numbers of rows and columns, respectively (represented as [[integer]]s);
*''<code>xllcorner</code>'' and ''<code>yllcorner</code>'' are the western (left) ''x''-[[Cartesian coordinates|coordinate]] and southern (bottom) ''y''-coordinates, such as [[easting and northing]] (represented as [[real number]]s with an optional decimal point)
:''<tt>nrows</tt>'' is the number of columns (an integer);
*''<code>cellsize</code>'' is the [[length]] of one side of a square cell (a real number); and,
:''<tt>xllcorner</tt>'' is the western (left) ''x''-[[Cartesian coordinates|coordinate]] (such as [[Easting]]);
*''<code>nodata_value</code>'' is the value that is regarded as "missing" or "not applicable"; this line is optional, but highly recommended as some programs expect this line to be declared (a real number).
:''<tt>yllcorner</tt>'' is the southern (bottom) ''y''-coordinate (such as [[Northing]]);
The remainder of the file lists the raster values for each cell, starting at the upper-left corner. These [[real number]]s (with optional decimal point, if needed) and are [[Delimiter-separated values|delimited]] using a single [[Space (punctuation)|space character]].
:''<tt>cellsize</tt>'' is the [[length]] of one side of a square cell; and,
:''<tt>nodata_value</tt>'' is the value that is regarded as "missing" or "not applicable"; this line is optional.
The remainder of the file, from line 7 onwards, lists the raster values for each cell, starting at the upper-left corner. These [[real number]]s and are [[Delimiter-separated values|delimited]] using a single [[Space (punctuation)|space character]].


===Binary format===
===Binary format===

Revision as of 22:24, 19 March 2007

An ESRI grid is a raster GIS file formats developed by ESRI, which has two formats:

  1. A proprietary binary format, also known as an ARC/INFO GRID, ARC GRID and many other variations
  2. A non-proprietary ASCII format, also known as an ARC/INFO ASCII GRID

The formats were introduced for ARC/INFO. The binary format is widely used within ESRI programs, such as ArcGIS, while the ASCII format is used as an exchange, or export format, due to the simple and portable ASCII file structure.

GIS grid

The grid defines geographic space as an array of equally sized square grid points arranged in rows and columns. Each grid point stores a numeric value that represents a geographic attribute (such as elevation or surface slope) for that unit of space. Each grid cell is referenced by its x,y coordinate location.

File formats

ASCII

The format is relatively straight-forward: the first six lines indicate the reference of the grid, followed by the values listed in the order they would naturally appear (left-right, top-down). For example, consider a grid, shown to the right. This could be encoded into an ASCII grid file, that would look like:

Grid image Values ASCII grid format
  1 2 3 4
1 5.5 −12.3 12.0 −8.5
2 NA −6.2 −8.1 −5.3
3 −9.4 0.0 −6.1 NA
4 −7.7 −6.4 3.6 10.7
5 −8.1 −13.2 −11.1 −2.6
6 NA NA 16.6 19.5
ncols         4
nrows         6
xllcorner     0.0
yllcorner     0.0
cellsize      100.0
NODATA_value  -9999.0
5.5 -12.3 12.0 -8.5
-9999.0 -6.2 -8.1 -5.3
-9.4 0.0 -6.1 -9999.0
-7.7 -6.4 3.6 10.7
-8.1 -13.2 -11.1 -2.6
-9999.0 -9999.0 16.6 19.5

where

  • ncols and nrows are the the numbers of rows and columns, respectively (represented as integers);
  • xllcorner and yllcorner are the western (left) x-coordinate and southern (bottom) y-coordinates, such as easting and northing (represented as real numbers with an optional decimal point)
  • cellsize is the length of one side of a square cell (a real number); and,
  • nodata_value is the value that is regarded as "missing" or "not applicable"; this line is optional, but highly recommended as some programs expect this line to be declared (a real number).

The remainder of the file lists the raster values for each cell, starting at the upper-left corner. These real numbers (with optional decimal point, if needed) and are delimited using a single space character.

Binary format

A binary ESRI grid is stored in several files contained in at least two directories: the name directory and an info directory, where name has strict naming conventions.

References

Binary grid
ASCII grid