File Formats:GRASS files

From Gsshawiki
Jump to: navigation, search

GRASS ASCII grid files are much like Arc/Info ASCII grid files. They are text files that contain a few header lines describing the size and location of the data followed by the data for the grid (row-ordered data with rows on each line, separated by spaces.) The data can either be integer values or floating-point (single or double) values. For example, index maps use integer values while the elevation map uses floating point values.

The first four header lines define the a bounding box for the grid cells, in UTM coordinates. The next two lines define the number of rows and columns there are in the grid. To obtain the cell dimensions in meters, take the difference between the appropriate bounding box coordinates and divide by the number of cells in that direction. For example, the following grid has a y-dimension grid cells size of (4969474.648439-4969114.648439)/12=30.0m. The header lines must have the identifying card and colon.

north: 4969474.648439
south: 4969114.648439
east: 552376.687907
west: 551986.687907
rows: 12
cols: 13
0.000000 372.779999 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
0.000000 372.380005 372.420013 372.410004 0.000000 0.000000 0.000000 0.000000 371.950012 371.839996 0.000000 0.000000 0.000000 
0.000000 372.359985 372.380005 372.299988 372.320007 372.250000 372.109985 371.940002 371.790009 371.670013 371.589996 0.000000 0.000000 
0.000000 372.209991 372.209991 372.070007 372.119995 372.049988 371.940002 371.730011 371.519989 371.380005 371.350006 0.000000 0.000000 
0.000000 372.040009 372.000000 371.959991 371.880005 371.839996 371.630005 371.359985 371.140015 371.100006 371.029999 370.880005 0.000000 
0.000000 0.000000 371.989990 371.920013 371.850006 371.779999 371.279999 370.850006 370.630005 370.799988 370.709991 370.429993 0.000000 
0.000000 0.000000 372.269989 371.950012 371.959991 371.670013 371.059998 370.380005 370.019989 370.119995 370.079987 369.929993 0.000000 
0.000000 0.000000 372.519989 371.989990 371.809998 371.390015 370.959991 369.859985 369.410004 369.100006 368.959991 368.980011 0.000000 
0.000000 372.649994 372.670013 372.079987 371.809998 371.179993 370.769989 369.269989 368.480011 367.910004 367.920013 368.040009 0.000000 
372.209991 372.230011 372.209991 372.160004 371.239990 370.950012 369.970001 368.559998 367.350006 367.089996 367.679993 367.730011 0.000000 
0.000000 372.040009 372.089996 371.980011 370.790009 369.529999 368.519989 367.809998 367.109985 367.029999 367.109985 367.250000 0.000000 
0.000000 0.000000 371.519989 371.510010 371.230011 368.339996 367.100006 367.089996 366.950012 366.899994 367.320007 367.350006 0.000000