GRASS logo

NAME

r.change.stats - Computes the pixelwise change from two input classifications. Optionally outputs spatial statistics of class changes calculated with r.stats.

KEYWORDS

raster, statistics, change detection, classification

SYNOPSIS

r.change.stats
r.change.stats --help
r.change.stats [-fcl] input=name[,name,...] output=name [window_size=integer] [csv_path=name] [ignore_value=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-f
Filter change detection product using a mode filter of size window_size
-c
Compute spatial statistics of class changes, optionally save them as a .csv-file
-l
Use raster labels for change detection statistics
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name[,name,...] [required]
Names of the two input classification maps
Change will be computed from input map 1 to input map 2
output=name [required]
Name for output raster map
window_size=integer
Size of mode filter if -f flag is set
-f flag must be set
csv_path=name
Filename for output .csv-file (if omitted or "-" output to stdout).
-c flag must be set
ignore_value=integer
Raster value to be ignored in change detection
All changes to or from this value will be assigned the same value and visualised in white. useful for e.g. cloud masking

Table of contents

DESCRIPTION

r.change.stats is a GRASS GIS addon Python script to calculate changes between two discrete raster maps, e.g. landcover classifications. It takes only exactly two raster maps and calculates the change detection based on the current region. The change map can be smoothened using a mode filter by applying the -f flag and window_size parameter. The output map contains category values for each combination of change (from class X to class Y), which is indicated in the category labels. If the -lflag is set, the category labels from the input raster maps are used to describe the change in the output category labels. If the -cflag is set, area statistics (in percentage of covered area) are written to stdout or to a .csv file if indicated in the parameter csv_path.

EXAMPLE

r.change.stats input=classification_2016,classification_2020 output=change_2016_2020
# Computes a change map between both classifications, the resulting change map will be labelled according to input raster category values, e.g.
# 1002	Change from 20 to 10
# 1003	Change from 30 to 10
# ...

r.change.stats -flc input=classification_2016,classification_2020 output=change_2016_2020 window_size=9 csv_path=statistics.csv
# Computes a change map between both classifications, applies a mode fui the result, and saves area statistics of changed areas in a .csv file.
# Both resulting map and statistics are labelled according to labels of the input rasters, e.g.
# 1002 Change from low vegetation to forest 1.45%
# 1003 Change from water to forest 0.00%
# ...

SEE ALSO

r.stats, r.neighbors, r.category, r.change.info (addon)

AUTHOR

Guido Riembauer, mundialis, Germany

SOURCE CODE

Available at: r.change.stats source code (history)

Accessed: Tuesday Apr 16 18:22:50 2024


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.4.0dev Reference Manual