QGIS Algorithm provided by QGIS (native c++) Round raster (native:roundrastervalues). This algorithm rounds the cell values of a raster dataset according to the specified number of decimals. Alternatively, a negative number of decimal places may be used to round values to powers of a base n (specified in the advanced parameter Base n). For example, with a Base value n of 10 and Decimal places of -1 the algorithm rounds cell values to multiples of 10, -2 rounds to multiples of 100, and so on. Arbitrary base values may be chosen, the algorithm applies the same multiplicative principle. Rounding cell values to multiples of a base n may be used to generalize raster layers. The algorithm preserves the data type of the input raster. Therefore byte/integer rasters can only be rounded to multiples of a base n, otherwise a warning is raised and the raster gets copied as byte/integer raster

qgis_roundrastervalues(
  INPUT = qgisprocess:::qgis_default_value(),
  BAND = qgisprocess:::qgis_default_value(),
  ROUNDING_DIRECTION = qgisprocess:::qgis_default_value(),
  DECIMAL_PLACES = qgisprocess:::qgis_default_value(),
  BASE_N = qgisprocess:::qgis_default_value(),
  CREATE_OPTIONS = qgisprocess:::qgis_default_value(),
  OUTPUT = qgisprocess:::qgis_default_value(),
  ...,
  .complete_output = .complete_output_option(),
  .quiet = .quiet_option(),
  .messages = .message_option()
)

Arguments

INPUT

raster - Input raster. Path to a raster layer.

BAND

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

ROUNDING_DIRECTION

enum of ("Round up", "Round to nearest", "Round down") - Rounding direction. Number of selected option, e.g. '1'. Comma separated list of options, e.g. '1,3'.

DECIMAL_PLACES

number - Number of decimals places. A numeric value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.

BASE_N

number - Base n for rounding to multiples of n. A numeric value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.

CREATE_OPTIONS

string - Creation options. String value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.

OUTPUT

rasterDestination - Output raster. Path for new raster 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

  • OUTPUT - outputRaster - Output raster