Code Editor (JavaScript)
// Kernel weights.
var weights = [[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4]];
print('A fixed kernel', ee.Kernel.fixed({weights: weights}));
/**
* Output weights matrix
*
* [4, 3, 2, 1, 2, 3, 4]
* [4, 3, 2, 1, 2, 3, 4]
* [4, 3, 2, 1, 2, 3, 4]
*/
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
weights = [[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4]]
print('A fixed kernel:')
pprint(ee.Kernel.fixed(**{'weights': weights}).getInfo())
# Output weights matrix
# [4, 3, 2, 1, 2, 3, 4]
# [4, 3, 2, 1, 2, 3, 4]
# [4, 3, 2, 1, 2, 3, 4]