ee.Kernel.chebyshev

根據 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 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

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]