车讯:广汽传祺GS8正式上市 售价16.38-25.98万

基于直线(曼哈顿)距离生成距离核。百度 ”在问到创作特色消防顺口溜的初衷时,周汝国这样回答道。

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

示例

代码编辑器 (JavaScript)

print('A Manhattan kernel', ee.Kernel.manhattan({radius: 3}));

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

Python 设置

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

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

print('A Manhattan kernel:')
pprint(ee.Kernel.manhattan(**{'radius': 3}).getInfo())

#  Output weights matrix

#  [6, 5, 4, 3, 4, 5, 6]
#  [5, 4, 3, 2, 3, 4, 5]
#  [4, 3, 2, 1, 2, 3, 4]
#  [3, 2, 1, 0, 1, 2, 3]
#  [4, 3, 2, 1, 2, 3, 4]
#  [5, 4, 3, 2, 3, 4, 5]
#  [6, 5, 4, 3, 4, 5, 6]