[GRASS-user] Understanding Raster Map Input Files

Moritz Lennert mlennert at club.worldonline.be
Thu Aug 30 08:12:03 PDT 2018


On 21/08/18 15:38, Vidura Dantanarayana wrote:
> Hi all,
> I'm currently doing my research on wildfire behavior modeling. For that 
> purpose, I'm using the wildfire behavior module in GRASS GIS. I came up 
> with these problems in understanding the sample raster map files 
> provided by GRASS GIS. The content is as follows,
> 
> File 01: 1hour_moisture
> 
> # 15 categories   --------------------------------------------------->   (1)
> 1 Hour Fuel Moisture of Bass River Fire of 1977 ------>   (2)
> 
> 0.00 0.00 0.00 0.00 ----------------------------------------------->   (3)
> 0:no data 
> ------------------------------------------------------------->   (4)
> 3:3 % 
> ------------------------------------------------------------------>   (5)
> 15:15 % 
> -------------------------------------------------------------->    (6)
> 
> Can you explain (1) to (6)
> 
> File 02: fire_origin
> 
> # 1 categories -----------------------------------------------------> (7)
> Map of Fire Origin of Bass River Fire --------------------> (8)
> 
> 0.00 0.00 0.00 0.00 ---------------------------------------------> (9)
> 0:no data -----------------------------------------------------------> (10)
> 1:fire origin ---------------------------------------------------------> 
> (11)
> 
> Well, also (7) to (11)

The fire demo data comes in a ready-made GRASS location formation. The 
easiest way to use it is to create a directory (traditionally called 
"GRASSDATA", but you can chose any name you like) and to decompress the 
contents of the fire_grass6data.tar.gz into that directory. You can then 
launch GRASS GIS, pointing it to the demolocation and the demomapset.

The information you mention above comes from internal files of the GRASS 
Database which contain the category and category labels information. You 
do not need to understand these internal formats (part of the GRASS 
raster format which is organized in a series of files). Generally, you 
should never have to actually go into the GRASS database, i.e. the 
directory where GRASS stores its data, to get information from files. 
You should rather access this information via the relevant modules.

For example you can see the same information using r.category:

r.category 1hour_moisture
3	3 %
15	15 %

which means that two categories are identified for this file: 3, which 
is labeled '3%' and 15 which is labeled '15%'.

Using, for example, r.stats you can see how many pixels of the map are 
in each category:

r.stats -c 1hour_moisture --q
3 27139
15 3098
* 48163

(* representing NULL pixels which don't contain a value).

Moritz








More information about the grass-user mailing list