1r.li.daemon(1)                Grass User's Manual               r.li.daemon(1)
2
3
4

Support for landscape index calculations on raster

DESCRIPTION

7       This documentation is focused on scientists and developers who wants to
8       implement a new landscape index computation. Refer to the r.li  modules
9       overview and g.gui.rlisetup module for user-focused documentation.
10
11       r.li.daemon provides support for landscape index calculations on raster
12       maps. It hides the management of areas,  defined  using  g.gui.rlisetup
13       command.  It  is  not used like a standalone program, but its functions
14       are a library used by all r.li.[index] commands.
15       This description is a tutorial for new index definition.
16       The developer has only to focus on a unique area, like in  mathematical
17       definitions, and has to write a C implementation of it.
18       The areas are defined using a struct called area_des and it members are
19       explained in the source code (doxygen) documentation.
20
21       To write a new index only two steps are needed:
22
23       1      Define a function and insert its declaration on file index.h  in
24              r.li.daemon  folder, which contains all index declarations. This
25              function must be of this kind:
26                      int index(int fd, char ** par, area_des ad, double * result)
27              where:
28
29           ·   fd is the raster map descriptor
30
31           ·   par is a matrix for special parameter (like argv in main)
32
33           ·   ad is the area descriptor
34
35           ·   result is where to put the index calculation result
36       This function has to return 1 on success and 0 otherwise.   This  func‐
37       tion type is defined using typedef named rli_func.
38
39       2      Create  a  main for command line arguments parsing, and call the
40              function
41                      int calculateIndex(char *file, rli_func *f,
42                                         char **parameters, char *raster, char *output);
43              from the r.li library, for starting raster analysis.
44              It follows the meaning of parameters:
45
46           ·   file name of configuration file created using g.gui.rlisetup
47
48           ·   f pointer to index function defined above
49
50           ·   parameters pointer to index special parameters
51
52           ·   raster name of raster to use
53
54           ·   output output file name
55
56       Compile it using a changed Makefile based on the file  for  r.li.patch‐
57       density.
58
59       Refer  to  the r.li library documentation in the source code and imple‐
60       mentation of r.li modules for details and examples.
61

NOTES

63       Using GRASS library function to access raster rows can slow down moving
64       windows execution. It is recommended to use
65       RLI_get_cell_row(int, int, area_des)
66       RLI_get_fcell_row(int, int, area_des)
67       RLI_get_dcell_row(int, int, area_des)
68       to use an ad hoc build memory management developed to speed up the sys‐
69       tem.  The documentation is in doxygen files.
70

SEE ALSO

72       old r.le manual
73       r.li - package overview
74       g.gui.rlisetup
75

REFERENCES

77       McGarigal, K., and B. J. Marks. 1995. FRAGSTATS: spatial pattern analy‐
78       sis  program for quantifying landscape structure. USDA For. Serv.  Gen.
79       Tech. Rep. PNW-351. (PDF)
80

AUTHORS

82       Claudio Porta and Lucio Davide Spano, students of Computer Science Uni‐
83       versity of Pisa (Italy).
84       Commission from Faunalia Pontedera (PI)
85       Rewritten from "r.le.setup" by William L. Baker
86       Various bug fixes by Markus Metz
87       This  program  is  free  software under the GPL (>=v2) Read the COPYING
88       file that comes with GRASS for details.
89
90       Main index | Topics index | Keywords index |  Graphical  index  |  Full
91       index
92
93       © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
94
95
96
97GRASS 7.8.2                                                     r.li.daemon(1)
Impressum