Raster class methods documentation

Each of the following functions are methods of Raster class.

  1. __abs__
  2. __add__
  3. __eq__
  4. __floordiv__
  5. __ge__
  6. __getitem__
  7. __gt__
  8. __iadd__
  9. __idiv__
  10. __imul__
  11. __init__
  12. __isub__
  13. __le__
  14. __lt__
  15. __mod__
  16. __mul__
  17. __ne__
  18. __neg__
  19. __pow__
  20. __setattr__
  21. __setitem__
  22. __sub__
  23. __truediv__
  24. acos
  25. acosh
  26. asin
  27. asinh
  28. atan
  29. atan2
  30. atanh
  31. calculate_clip_values
  32. calculate_mean
  33. calculate_mean_and_stdev
  34. ceil
  35. con
  36. configs
  37. cos
  38. cosh
  39. decrement
  40. decrement_row_data
  41. deep_copy
  42. exp
  43. exp2
  44. file_mode
  45. file_name
  46. floor
  47. get_column_from_x
  48. get_data_size_in_bytes
  49. get_row_data
  50. get_row_from_y
  51. get_value
  52. get_value_as_hsi
  53. get_value_as_rgba
  54. get_x_from_column
  55. get_y_from_row
  56. increment
  57. increment_row_data
  58. is_nodata
  59. ln
  60. log10
  61. log2
  62. max
  63. min
  64. new_from_other
  65. num_cells
  66. num_valid_cells
  67. raster_type
  68. reinitialize_values
  69. set_data_from_raster
  70. set_row_data
  71. set_value
  72. set_value_from_rgba
  73. signum
  74. sin
  75. sinh
  76. size_of
  77. sqrt
  78. square
  79. tan
  80. tanh
  81. to_degrees
  82. to_radians
  83. trunc
  84. update_display_min_max
  85. update_min_max

__abs__

abs(self)

Function Signature

def __abs__(self) -> Raster: ...

__add__

Return self+value.

Function Signature

def __add__(self, other: Union[Raster, float]) -> Raster: ...

__eq__

Return self==value.

Function Signature

def __eq__(self, other: Union[Raster, float]) -> Raster: ...

__floordiv__

Return self//value.

Function Signature

def __floordiv__(self, other: Union[Raster, float]) -> Raster: ...

__ge__

Return self>=value.

Function Signature

def __ge__(self, other: Union[Raster, float]) -> Raster: ...

__getitem__

Return self[key].

Function Signature

def __getitem__(self, index: int) -> VectorGeometry: ...

__gt__

Return self>value.

Function Signature

def __gt__(self, other: Union[Raster, float]) -> Raster: ...

__iadd__

Return self+=value.

Function Signature

def __iadd__(self, other: Union[Raster, float]) -> None: ...

__idiv__

No documentation found.

Function Signature

def __idiv__(self, other: Union[Raster, float]) -> None: ...

__imul__

Return self*=value.

Function Signature

def __imul__(self, other: Union[Raster, float]) -> None: ...

__init__

Initialize self. See help(type(self)) for accurate signature.

Function Signature

def __init__(self):

__isub__

Return self-=value.

Function Signature

def __isub__(self, other: Union[Raster, float]) -> None: ...

__le__

Return self<=value.

Function Signature

def __le__(self, other: Union[Raster, float]) -> Raster: ...

__lt__

Return self<value.

Function Signature

def __lt__(self, other: Union[Raster, float]) -> Raster: ...

__mod__

Return self%value.

Function Signature

def __mod__(self, other: Union[Raster, float]) -> Raster: ...

__mul__

Return self*value.

Function Signature

def __mul__(self, other: Union[Raster, float]) -> Raster: ...

__ne__

Return self!=value.

Function Signature

def __ne__(self, other: Union[Raster, float]) -> Raster: ...

__neg__

-self

Function Signature

def __neg__(self) -> Raster: ...

__pow__

Return pow(self, value, mod).

Function Signature

def __pow__(self, other: Union[Raster, float], modulo: Optional[float] = None) -> Raster: ...

__setattr__

Implement setattr(self, name, value).

__setitem__

Set self[key] to value.

Function Signature

def __setitem__(self, row_column: Tuple[int, int], value: float) -> None: ...

__sub__

Return self-value.

Function Signature

def __sub__(self, other: Union[Raster, float]) -> Raster: ...

__truediv__

Return self/value.

Function Signature

def __truediv__(self, other: Union[Raster, float]) -> Raster: ...

acos

No documentation found.

Function Signature

def acos(self) -> Raster: ...

acosh

No documentation found.

Function Signature

def acosh(self) -> Raster: ...

asin

No documentation found.

Function Signature

def asin(self) -> Raster: ...

asinh

No documentation found.

Function Signature

def asinh(self) -> Raster: ...

atan

No documentation found.

Function Signature

def atan(self) -> Raster: ...

atan2

No documentation found.

Function Signature

def atan2(self, other: Union[Raster, float]) -> Raster: ...

atanh

No documentation found.

Function Signature

def atanh(self) -> Raster: ...

calculate_clip_values

No documentation found.

Function Signature

def calculate_clip_values(self, percent: float) -> Tuple[float, float]: ...

calculate_mean

No documentation found.

Function Signature

def calculate_mean(self) -> float: ...

calculate_mean_and_stdev

No documentation found.

Function Signature

def calculate_mean_and_stdev(self) -> Tuple[float, float]: ...

ceil

No documentation found.

Function Signature

def ceil(self) -> Raster: ...

con

The ConditionalEvaluation tool can be used to perform an if-then-else style conditional evaluation on a raster image on a cell-to-cell basis. The user specifies the names of an input raster image (--input) and an output raster (--output), along with a conditional statement (--statement). The grid cell values in the output image will be determined by the TRUE and FALSE values and conditional statement. The conditional statement is a logical expression that must evaluate to either a Boolean, i.e. TRUE or FALSE. Then depending on how this statement evaluates for each grid cell, the TRUE or FALSE values will be assigned to the corresponding
grid cells of the output raster. The TRUE or FALSE values may take the form of either a constant numerical value or a raster image (which may be the same image as the input). These are specified by the --true and --false parameters, which can be either a file name pointing to existing rasters, or numerical values.

The conditional statement is a single-line logical condition. In addition to the common comparison and logical
operators, i.e. < > <= >= == (EQUAL TO) != (NOT EQUAL TO) || (OR) && (AND) (Note: or, OR, and and AND are also valid operators), conditional statements may contain a number of valid mathematical functions. For example:

 * log(base=10, val) -- Logarithm with optional 'base' as first argument.
 If not provided, 'base' defaults to '10'.
 Example: log(100) + log(e(), 100)

 * e()  -- Euler's number (2.718281828459045)
 * pi() -- π (3.141592653589793)

 * int(val)
 * ceil(val)
 * floor(val)
 * round(modulus=1, val) -- Round with optional 'modulus' as first argument.
     Example: round(1.23456) == 1 && round(0.001, 1.23456) == 1.235

 * abs(val)
 * sign(val)

 * min(val, ...) -- Example: min(1, -2, 3, -4) == -4
 * max(val, ...) -- Example: max(1, -2, 3, -4) == 3

 * sin(radians)    * asin(val)
 * cos(radians)    * acos(val)
 * tan(radians)    * atan(val)
 * sinh(val)       * asinh(val)
 * cosh(val)       * acosh(val)
 * tanh(val)       * atanh(val)

Notice that the constants Pi and e must be specified as functions, pi() and e(). A number of global variables are also available to build conditional statements. These include the following:

Special Variable Names For Use In Conditional Statements:

NameDescription
valueThe grid cell value.
nodataThe input raster's NoData value.
nullSame as nodata.
minvalueThe input raster's minimum value.
maxvalueThe input raster's maximum value.
rowsThe input raster's number of rows.
columnsThe input raster's number of columns.
rowThe grid cell's row number.
columnThe grid cell's column number.
rowyThe row's y-coordinate.
columnxThe column's x-coordinate.
northThe input raster's northern coordinate.
southThe input raster's southern coordinate.
eastThe input raster's eastern coordinate.
westThe input raster's western coordinate.
cellsizexThe input raster's grid resolution in the x-direction.
cellsizeyThe input raster's grid resolution in the y-direction.
cellsizeThe input raster's average grid resolution.

The special variable names are case-sensitive. Each of the special variable names can also be used as valid TRUE or FALSE constant values.

The following are examples of valid conditional statements:

value != 300.0

row > (rows / 2)

value >= (minvalue + 35.0)

(value >= 25.0) && (value <= 75.0)

tan(value * pi() / 180.0) > 1.0

value == nodata

Any grid cell in the input raster containing the NoData value will be assigned NoData in the output raster, unless a NoData grid cell value allows the conditional statement to evaluate to True (i.e. the conditional statement includes the NoData value), in which case the True value will be assigned to the output.

Function Signature

def con(self, con_statement: str, true_raster_or_float: Union[Raster, float, str], false_raster_or_float: Union[Raster, float, str]) -> Raster: ...

configs

Function Signature

def configs(self) -> RasterConfigs: ...

cos

No documentation found.

Function Signature

def cos(self) -> Raster: ...

cosh

No documentation found.

Function Signature

def cosh(self) -> Raster: ...

decrement

No documentation found.

Function Signature

def decrement(self, row: int, column: int, value: float) -> None: ...

decrement_row_data

No documentation found.

Function Signature

def decrement_row_data(self, row: int, values: List[float]) -> None: ...

deep_copy

Makes a deep copy of a Raster, returning the new Raster object.

Function Signature

def deep_copy(self) -> Raster: ...

exp

No documentation found.

Function Signature

def exp(self) -> Raster: ...

exp2

No documentation found.

Function Signature

def exp2(self) -> Raster: ...

file_mode

Function Signature

def file_mode(self) -> str: ...

file_name

Function Signature

def file_name(self, value: str) -> None: ...

floor

No documentation found.

Function Signature

def floor(self) -> Raster: ...

get_column_from_x

No documentation found.

Function Signature

def get_column_from_x(self, x: float) -> int: ...

get_data_size_in_bytes

Returns the size of the pixel data in bytes.

Function Signature

def get_data_size_in_bytes(self) -> int: ...

get_row_data

No documentation found.

Function Signature

def get_row_data(self, row: int) -> List[float]: ...

get_row_from_y

No documentation found.

Function Signature

def get_row_from_y(self, y: float) -> int: ...

get_value

Returns the value contained within a grid cell specified by row and column.

Function Signature

def get_value(self, row: int, column: int) -> float: ...

get_value_as_hsi

Returns the hue, saturation, and intensity equivalent of a grid cell. This assumes that the grid cell contains red, green, blue data, i.e. that the DataType is RGB.

Function Signature

def get_value_as_hsi(self, row: int, column: int) -> Tuple[float, float, float]: ...

get_value_as_rgba

Returns the red, green, blue, and opacity values from a grid cell, assuming that the cell contains colour data, i.e. that the DataType is RGB.

Function Signature

def get_value_as_rgba(self, row: int, column: int) -> Tuple[int, int, int, int]: ...

get_x_from_column

No documentation found.

Function Signature

def get_x_from_column(self, column: int) -> float: ...

get_y_from_row

No documentation found.

Function Signature

def get_y_from_row(self, row: int) -> float: ...

increment

No documentation found.

Function Signature

def increment(self, row: int, column: int, value: float) -> None: ...

increment_row_data

No documentation found.

Function Signature

def increment_row_data(self, row: int, values: List[float]) -> None: ...

is_nodata

No documentation found.

Function Signature

def is_nodata(self) -> Raster: ...

ln

No documentation found.

Function Signature

def ln(self) -> Raster: ...

log10

No documentation found.

Function Signature

def log10(self) -> Raster: ...

log2

No documentation found.

Function Signature

def log2(self) -> Raster: ...

max

No documentation found.

Function Signature

def max(self, other: Union[Raster, float]) -> Raster: ...

min

No documentation found.

Function Signature

def min(self, other: Union[Raster, float]) -> Raster: ...

new_from_other

Creates a new in-memory Raster object with grid extent and location based on an existing Raster contained within file_name.

Function Signature

def new_from_other(other: Raster, data_type: Union[RasterDataType, None]) -> Raster: ...

num_cells

No documentation found.

Function Signature

def num_cells(self) -> int: ...

num_valid_cells

No documentation found.

Function Signature

def num_valid_cells(self) -> int: ...

raster_type

Function Signature

def raster_type(self) -> RasterType: ...

reinitialize_values

No documentation found.

Function Signature

def reinitialize_values(self, value: float) -> None: ...

set_data_from_raster

No documentation found.

Function Signature

def set_data_from_raster(self, other: Raster) -> Union[None, str]: ...

set_row_data

No documentation found.

Function Signature

def set_row_data(self, row: int, values: List[float]) -> None: ...

set_value

No documentation found.

Function Signature

def set_value(self, row: int, column: int, value: float) -> None: ...

set_value_from_rgba

No documentation found.

Function Signature

def set_value_from_rgba(self, row: int, column: int, rgba: Tuple[int, int, int, int]) -> None: ...

signum

Returns a raster that where each cell is assigned a number that represents the sign of the corresponding grid cell in the source raster. The transformation follows the rules below:

  • 1.0 if the number is positive, +0.0 or INFINITY
  • -1.0 if the number is negative, -0.0 or NEG_INFINITY
  • NaN if the number is NaN

Function Signature

def signum(self) -> Raster: ...

sin

No documentation found.

Function Signature

def sin(self) -> Raster: ...

sinh

No documentation found.

Function Signature

def sinh(self) -> Raster: ...

size_of

No documentation found.

Function Signature

def size_of(self) -> int: ...

sqrt

No documentation found.

Function Signature

def sqrt(self) -> Raster: ...

square

No documentation found.

Function Signature

def square(self) -> Raster: ...

tan

No documentation found.

Function Signature

def tan(self) -> Raster: ...

tanh

No documentation found.

Function Signature

def tanh(self) -> Raster: ...

to_degrees

No documentation found.

Function Signature

def to_degrees(self) -> Raster: ...

to_radians

No documentation found.

Function Signature

def to_radians(self) -> Raster: ...

trunc

No documentation found.

Function Signature

def trunc(self) -> Raster: ...

update_display_min_max

No documentation found.

update_min_max

No documentation found.

Function Signature

def update_min_max(self) -> None: ...