GRASS logo


r.pi - Toolset for multiscale analysis of landscape patch structure.

Table of contents


raster, landscape structure analysis, neutral landscapes, patch index


r.pi (raster patch index) provides various functions to analyse spatial attributes of a landscape. It has a focus on patch-based indices but delivers class-based indices as well. r.le and its successor provide landscape indices.

A list with a short description of the r.pi modules can be found below. More in depth description of a certain module (commands, flags, options) can be found in the respective folder (like r.pi.graph). The functions/algorithms of the modules are not yet very extensive but will be expanded in the future. Please submit any bug/feature you might encounter to improve the functionality.

The program will interactively query the user for input, output and options (GUI). However the module can be also run from the terminal prompt (CLI) and might be implemented in e.g. a bash-script.

It is highly recommended to read the help pages or e.g the overview documents of Fragstats to get a better impression of problems, possibilities and caveats.

General and Connectivity Indices

Individual-based dispersal models


Neutral Landscape Model

Various modules


Calculation of the SHAPE-Index

Input can be generated by r.pi.nlm, for example:
# generate random landscape with 50% cover
r.pi.nlm output=NLM_in landcover=50 sharpness=0.5

# use the class 1 of the above generated landscape for computation of SHAPE-Index
r.pi.index input=NLM_in keyval=1 output=NLM_in.shape method=shape

Calculation of the distance to the first and 10th Nearest Neighbor

Input generated by r.pi.nlm, for example:
# generate random landscape with 50% cover
r.pi.nlm output=NLM_in landcover=50 sharpness=0.5

# first NN
r.pi.index input=NLM_in keyval=1 output=NLM_in.enn1 method=ENN

# 10th NN
r.pi.enn input=NLM_in output=NLM_in.enn10 method=distance number=10

# 1-10th NN
r.pi.enn input=NLM_in output=NLM_in.enn10 method=distance number=1-10


The maximum number of patches that can be queried at one time depend on the module and might also be influenced by the resolution.

SEE ALSO,,, r.pi.enn,, r.pi.neigh, r.pi.fnn, r.pi.nlm.circ, r.pi.nlm, r.nlm.stats, r.pi.corearea,, r.pi.export, r.pi.graph, r.pi.graph.dec,,, r.pi.grow, r.pi.import, r.pi.index, r.pi.lm, r.pi.odc,, r.pi.rectangle, r.pi.searchtime,,




This software is released under the GPL license, hence also the limitation of liability. This software was designed for a certain project and its research questions. Its nomenclature might not be concordant with other software packages. Moreover its capabilities are yet limited and can not be compared to such of e.g. Fragstats, however every user is invited to extend, modify or fix the functionality of r.pi as long as the new code comply with the GPL.


Programming: Elshad Shirinov
Scientific concept: Martin Wegmann
Department of Remote Sensing
Remote Sensing and Biodiversity Unit
University of Wuerzburg, Germany

Port to GRASS GIS 7: Markus Metz

Documentation improvements: Markus Neteler


Available at: r.pi source code (history)

Latest change: Tuesday Sep 19 09:59:22 2023 in commit: e76c325998c8cd9053ce012a5adbb79f33ab0779

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

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