Raster class documentation
Each of the following functions are methods of Raster
class.
__abs__
__add__
__eq__
__floordiv__
__ge__
__getitem__
__getstate__
__gt__
__iadd__
__idiv__
__imul__
__init__
__isub__
__le__
__lt__
__mod__
__mul__
__ne__
__neg__
__pow__
__setattr__
__setitem__
__sub__
__truediv__
- acos
- acosh
- asin
- asinh
- atan
- atan2
- atanh
- calculate_clip_values
- calculate_mean
- calculate_mean_and_stdev
- ceil
- clip_display_max
- clip_display_min
- clip_display_min_max
- con
- configs
- cos
- cosh
- decrement
- decrement_row_data
- deep_copy
- exp
- exp2
- file_mode
- file_name
- floor
- get_column_from_x
- get_data_size_in_bytes
- get_file_extension
- get_row_data
- get_row_data_as_rgba
- get_row_from_y
- get_short_filename
- get_value
- get_value_as_hsi
- get_value_as_rgba
- get_x_from_column
- get_y_from_row
- increment
- increment_row_data
- is_nodata
- ln
- log10
- log2
- max
- min
- new_from_other
- normalize
- num_cells
- num_valid_cells
- raster_type
- reinitialize_values
- set_data_from_raster
- set_row_data
- set_value
- set_value_from_rgba
- signum
- sin
- sinh
- size_of
- sqrt
- square
- tan
- tanh
- to_degrees
- to_radians
- trunc
- update_display_min_max
- 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:
Name | Description |
---|---|
value | The grid cell value. |
nodata | The input raster's NoData value. |
null | Same as nodata . |
minvalue | The input raster's minimum value. |
maxvalue | The input raster's maximum value. |
rows | The input raster's number of rows. |
columns | The input raster's number of columns. |
row | The grid cell's row number. |
column | The grid cell's column number. |
rowy | The row's y-coordinate. |
columnx | The column's x-coordinate. |
north | The input raster's northern coordinate. |
south | The input raster's southern coordinate. |
east | The input raster's eastern coordinate. |
west | The input raster's western coordinate. |
cellsizex | The input raster's grid resolution in the x-direction. |
cellsizey | The input raster's grid resolution in the y-direction. |
cellsize | The 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: ...