geetools.Array
#
Extra methods for the ee.Array
class.
Warning
As reported in gee-community/geetools#173, this object cannot be extended before the API of Earth Enfine is initialized. So to use the following methods, you will be forced to manually import the following:
from geetools.Array import ArrayAccessor
Package Contents#
Classes#
Toolbox for the |
- class geetools.Array.ArrayAccessor(obj)[source]#
Toolbox for the
ee.Array
class.Initialize the Array class.
- Parameters:
obj (ee.Array) –
- full(width, height, value)[source]#
Create an array with the given dimensions, initialized to the given value.
- Parameters:
width (geetools.types.ee_number) – The width of the array.
height (geetools.types.ee_number) – The height of the array.
value (geetools.types.ee_number) – The value to initialize the array with.
- Returns:
An array with the given dimensions, initialized to the given value.
- Return type:
ee.Array
Examples
import ee, geetools ee.Initialize() arr = ee.Array.geetools.full(3, 3, 1) arr.getInfo()
- set(x, y, value)[source]#
Set the value of a cell in an array.
- Parameters:
x (geetools.types.ee_int) – The x coordinate of the cell.
y (geetools.types.ee_int) – The y coordinate of the cell.
value (geetools.types.ee_number) – The value to set the cell to.
- Returns:
The array with the cell set to the given value.
- Return type:
ee.Array
Examples
import ee, geetools ee.Initialize() arr = ee.Array.geetools.full(3, 3, 1) arr.geetools.set(1, 1, 0).getInfo()