r.pi.export
Export of patch based information.
r.pi.export [-a] input=name output=string [values=string] [id_raster=string] [patch_raster=string] stats=string [,string,...] [title="phrase"] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
r.pi.export input=name output=string stats=string
grass.script.run_command("r.pi.export", input, output, values=None, id_raster=None, patch_raster=None, stats, title=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("r.pi.export", input="name", output="string", stats="string")
Parameters
input=name [required]
Name of input raster map
output=string [required]
Name for the output ASCII-file
values=string
Name for the output ASCII-file with patch values
id_raster=string
Name for the ID raster map
patch_raster=string
Name for the patch raster map
stats=string [,string,...] [required]
Statistical method to perform on the values
Allowed values: average, variance, standard deviation, median, min, max
title="phrase"
Title for resultant raster map
-a
Set for 8 cell-neighbors. 4 cell-neighbors are default
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
input : str, required
Name of input raster map
Used as: input, raster, name
output : str, required
Name for the output ASCII-file
Used as: output
values : str, optional
Name for the output ASCII-file with patch values
Used as: output
id_raster : str, optional
Name for the ID raster map
Used as: output, raster
patch_raster : str, optional
Name for the patch raster map
Used as: output, raster
stats : str | list[str], required
Statistical method to perform on the values
Allowed values: average, variance, standard deviation, median, min, max
title : str, optional
Title for resultant raster map
Used as: "phrase"
flags : str, optional
Allowed values: a
a
Set for 8 cell-neighbors. 4 cell-neighbors are default
overwrite: bool, optional
Allow output files to overwrite existing files
Default: False
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
This module exports raster patch values (no single pixels, but single individual patch values), which can be used for subsequent analysis in R and later import into GRASS again, using r.pi.import.
NOTES
This module...
EXAMPLE
An example for the North Carolina sample dataset: generating a patch index map for later export:
r.pi.index input=landclass96 output=landclass96_forestclass5_area keyval=5 method=area
export this resulting map:
r.pi.export input=landclass96_forestclass5_area output=patch_area_out values=patch_area_values id_raster=forestclass5_ID stats=average,variance,min
various resulting files are generated:
patch_area_out: a text file with the average, variance and
minimum statistics as defined above and additionally informaton about
the percentage coverage (landcover) and the number of fragments
(number) of the analysed landcover.
patch_area_values: a text file with the actual patch values not the
statistics. The first column is providing the corresponding patch ID,
which is also existing in the forestclass5_ID raster map
(here:0-878). The second column is providing the percentage cover of
each patch (sum is equal the overall coverage: 0.506). The third column
is holding the actual patch index value (here area; e.g. patch 0: 12).
SEE ALSO
r.pi.corearea, r.pi.corr.mw, r.pi.csr.mw, r.pi.graph, r.pi.graph.dec, r.pi.graph.pr, r.pi.graph.red, r.pi.grow, r.pi.import, r.pi.index, r.pi.lm, r.pi.odc, r.pi.prob.mw, r.pi.rectangle, r.pi
AUTHORS
Programming: Elshad Shirinov
Scientific concept: Dr. Martin Wegmann
Department of Remote Sensing
Remote Sensing and Biodiversity Unit
University of Wuerzburg, Germany
Port to GRASS GIS 7: Markus Metz
SOURCE CODE
Available at: r.pi.export source code
(history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819