QGIS Algorithm provided by QGIS (native c++) Raster layer zonal statistics (native:rasterlayerzonalstats). Calculates statistics for a raster layer's values, categorized by zones defined in another raster layer. This algorithm calculates statistics for a raster layer's values, categorized by zones defined in another raster layer. If the reference layer parameter is set to "Input layer", then zones are determined by sampling the zone raster layer value at the centroid of each pixel from the source raster layer. If the reference layer parameter is set to "Zones layer", then the input raster layer will be sampled at the centroid of each pixel from the zones raster layer. If either the source raster layer or the zone raster layer value is NoData for a pixel, that pixel's value will be skipped and not included in the calculated statistics.

qgis_rasterlayerzonalstats(
  INPUT = qgisprocess:::qgis_default_value(),
  BAND = qgisprocess:::qgis_default_value(),
  ZONES = qgisprocess:::qgis_default_value(),
  ZONES_BAND = qgisprocess:::qgis_default_value(),
  REF_LAYER = qgisprocess:::qgis_default_value(),
  OUTPUT_TABLE = qgisprocess:::qgis_default_value(),
  ...,
  .complete_output = .complete_output_option(),
  .quiet = .quiet_option(),
  .messages = .message_option()
)

Arguments

INPUT

raster - Input layer. Path to a raster layer.

BAND

band - Band number. Integer value representing an existing raster band number.

ZONES

raster - Zones layer. Path to a raster layer.

ZONES_BAND

band - Zones band number. Integer value representing an existing raster band number.

REF_LAYER

enum of ("Input layer", "Zones layer") - Reference layer. Number of selected option, e.g. '1'. Comma separated list of options, e.g. '1,3'.

OUTPUT_TABLE

sink - Statistics. Path for new vector layer.

...

further parameters passed to qgisprocess::qgis_run_algorithm()

.complete_output

logical specifying if complete out of qgisprocess::qgis_run_algorithm() should be used (TRUE) or first output (most likely the main) should read (FALSE). Default value is TRUE.

.quiet

logical specifying if parameter .quiet for qgisprocess::qgis_run_algorithm() Default value is TRUE.

.messages

logical specifying if messages from qgisprocess::qgis_run_algorithm() should be printed (TRUE) or not (FALSE). Default value is FALSE.

Details

Outputs description

  • CRS_AUTHID - outputString - CRS authority identifier

  • EXTENT - outputString - Extent

  • HEIGHT_IN_PIXELS - outputNumber - Height in pixels

  • NODATA_PIXEL_COUNT - outputNumber - NoData pixel count

  • OUTPUT_TABLE - outputVector - Statistics

  • TOTAL_PIXEL_COUNT - outputNumber - Total pixel count

  • WIDTH_IN_PIXELS - outputNumber - Width in pixels