This function scans an input binary raster to assess zones and then computes the porosity of each unique zone.
porosity(IN=data$rst,
PLOT=TRUE,
NEIGH=4)
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.
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.
This is a Boolean flag that controls whether plots will be provided as output during processing.
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.
Tarmo K. Remmel
Remmel, T.K. 2018. An incremental and philosophically different approach to measuring raster patch porosity. Sustainability 10:3413.
See also the package 'raster
'.
porosity(IN=data$rst, PLOT=TRUE, NEIGH=4)
Run the code above in your browser using DataLab