ee.Kernel.chebyshev

基于切比雪夫距离(沿任一维度的最大距离)生成距离核。

用法返回
ee.Kernel.chebyshev(radius, units, normalize, magnitude)内核
参数类型详细信息
radius浮点数要生成的内核的半径。
units字符串,默认值:“pixels”内核的测量系统(“像素”或“米”)。如果以米为单位指定了内核,则当缩放级别发生变化时,内核会调整大小。
normalize布尔值,默认值:false将内核值归一化为总和为 1。
magnitude浮点数,默认值:1按此量缩放每个值。

示例

代码编辑器 (JavaScript)

print('A Chebyshev distance kernel', ee.Kernel.chebyshev({radius: 3}));

/**
 * Output weights matrix
 *
 * [3, 3, 3, 3, 3, 3, 3]
 * [3, 2, 2, 2, 2, 2, 3]
 * [3, 2, 1, 1, 1, 2, 3]
 * [3, 2, 1, 0, 1, 2, 3]
 * [3, 2, 1, 1, 1, 2, 3]
 * [3, 2, 2, 2, 2, 2, 3]
 * [3, 3, 3, 3, 3, 3, 3]
 */

Python 设置

如需了解 Python API 和如何使用 geemap 进行交互式开发,请参阅 Python 环境页面。

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

print('A Chebyshev distance kernel:')
pprint(ee.Kernel.chebyshev(**{'radius': 3}).getInfo())

#  Output weights matrix
#  [3, 3, 3, 3, 3, 3, 3]
#  [3, 2, 2, 2, 2, 2, 3]
#  [3, 2, 1, 1, 1, 2, 3]
#  [3, 2, 1, 0, 1, 2, 3]
#  [3, 2, 1, 1, 1, 2, 3]
#  [3, 2, 2, 2, 2, 2, 3]
#  [3, 3, 3, 3, 3, 3, 3]