Raster class documentation

Each of the following functions are methods of Raster class.

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

__getstate__

Helper for pickle.

__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: ...

clip_display_max

No documentation found.

clip_display_min

No documentation found.

clip_display_min_max

No documentation found.

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 a conditional 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 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, an existing raster image (which may be the same image as the input), or any of the strings 'null', 'nodata', or 'value'.

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_file_extension

Returns the file extension.

Function Signature

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

get_row_data

No documentation found.

Function Signature

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

get_row_data_as_rgba

No documentation found.

Function Signature

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

get_row_from_y

No documentation found.

Function Signature

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

get_short_filename

Returns the file name of the Raster, without the directory and file extension.

Function Signature

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

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: Optional[RasterDataType]) -> Raster: ...

normalize

No documentation found.

Function Signature

def normalize(self) -> 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) -> Optional[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: ...