Learn R Programming

ShapePattern (version 3.1.0)

porosity: Compute the porosity of raster zones (patches)

Description

This function scans an input binary raster to assess zones and then computes the porosity of each unique zone.

Usage

porosity(IN=data$rst, 
            PLOT=TRUE,
            NEIGH=4)

Value

The returned object is a dataframe with one row for each zone, and columns: Zone, N, Jact, Jmax, and Porosity. Here Zone is the unique ID for a specific raster zone of contiguous cells, N is the nuber of cells comprising that zone, Jact stores the number of actual internal edge-edge joins within the zone, Jmax is the theoretical maximum number of edge-edge joins based on N, and Porosity is the computed porosity value.

Arguments

IN

This is a binary raster input object. This raster will be clumped (i.e., like Esri's ArcGIS 'regiongroup' functionality) to produce zones of contiguous pixels. Each contiguous zone will be assessed for its porosity, or deviation from a theoretically maximally compact shape.

PLOT

This is a Boolean flag that controls whether plots will be provided as output during processing.

NEIGH

This is an integer, either 4 or 8 that controls whether a Rook's case or Queen's case neighbourhood contiguity is used to assess the zones.

Author

Tarmo K. Remmel

References

Remmel, T.K. 2018. An incremental and philosophically different approach to measuring raster patch porosity. Sustainability 10:3413.

See Also

See also the package 'raster'.

Examples

Run this code
porosity(IN=data$rst, PLOT=TRUE, NEIGH=4)

Run the code above in your browser using DataLab