1r.li.daemon(1) Grass User's Manual r.li.daemon(1)
2
3
4
6 r.li.daemon provides a support for landscape index calculation on
7 raster maps. It hides the managment of areas, defined using r.li.setup
8 command. It do not have to be used like a standalone program, but its
9 functions are a library used by all r.li.[index] commands.
10 This description is a tutorial for new index definition.
11 The developer has only to focus on a unique area, like in mathematical
12 definitions, and has to write a C implementation of it.
13 The areas are defined using a struct called area_des and it members are
14 explained in the source code (doxygen) documentation.
15
16 To write a new index only two steps are needed:
17
18 1 Define a function and insert its declaration on file index.h in
19 r.li.daemon folder, which contains all index declarations. This
20 function must be of this kind:
21 int index(int fd, char ** par, area_des ad, double *
22 result)
23
24 where:
25
26 fd is the raster map descriptor
27
28 par is a matrix for special parameter (like argv in main)
29
30 ad is the area descriptor
31
32 result is where to put the index calculation result
33 This function has to return 1 on success and 0 otherwise.
34
35 6 Create a main for command line arguments parsing, and call the
36 function
37 int calculateIndex(char * file, int f(int, char**
38 area_des, double *), char **parameters, char *raster, char *out‐
39 put);
40
41 from the r.li library, for starting raster analysis.
42 It follows the meaning of parameters:
43
44 file name of configuration file created using r.li.setup
45
46 f pointer to index function defined above
47
48 parameters pointer to index special parameters
49
50 raster name of raster to use
51
52 output output file name
53
54 Compile it using a changed Makefile based on the file for r.li.patch‐
55 density.
56
58 Using GRASS library function to access raster rows can slow down moving
59 windows execution. It is recommended to use
60 RLI_get_cell_row(int, int, area_des)
61 RLI_get_fcell_row(int, int, area_des)
62 RLI_get_dcell_row(int, int, area_des)
63
64 to use an ad hoc build memory managment developed to speed up the sys‐
65 tem. The documentation is in doxygen files.
66
68 old r.le manual
69 r.li package overview
70 r.li.patchdensity, r.li.setup
71
73 Claudio Porta and Lucio Davide Spano, students of Computer Science Uni‐
74 versity of Pisa (Italy).
75 Commission from Faunalia Pontedera (PI)
76 Rebuild of r.le.setup from William L. Baker This program is free soft‐
77 ware under the GPL (>=v2) Read the COPYING file that comes with GRASS
78 for details.
79
81 Pleas send bugs reports to spano@cli.di.unipi.it, porta@cli.di.unipi.it
82
83 Last changed: $Date: 2007-03-11 18:50:13 +0100 (Sun, 11 Mar 2007) $
84
85 Full index
86
87
88
89GRASS 6.3.0 r.li.daemon(1)