Circle Kernel at 10m (px): Tile error: Output of image computation is too large (2 bands for 122013995 pixels = 1861.8 MiB > 80.0 MiB). If this is a reduction, try specifying a larger 'tileScale' parameter.
Generates a circle-shaped boolean kernel.
radius (Float):
The radius of the kernel to generate.
units (String, default: "pixels"):
The system of measurement for the kernel ('pixels' or 'meters'). If the kernel is specified in meters, it will resize when the zoom-level is changed.
normalize (Boolean, default: true):
Normalize the kernel values to sum to 1.
magnitude (Float, default: 1):
Scale each value by this amount.
Convolves each band of an image with the given kernel.用给定的核卷积图像的每个波段。
this:image (Image):
The image to convolve.
kernel (Kernel):
The kernel to convolve with.
//研究区和数据集
var imageCollection = ee.ImageCollection("COPERNICUS/S1_GRD"),
geometry =
/* color: #98ff00 */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[-3.4157601749762367, 56.09914841569624],
[-3.4157601749762367, 55.81469755998435],
[-2.8334847843512367, 55.81469755998435],
[-2.8334847843512367, 56.09914841569624]]], null, false),
geometry2 =
/* color: #0b4a8b */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[-3.414419891474414, 56.01742307470684],
[-3.414419891474414, 55.98877181348714],
[-3.3768260499216796, 55.98877181348714],
[-3.3768260499216796, 56.01742307470684]]], null, false);
//数据过滤和筛选
var filtered = imageCollection
.filterBounds(geometry)
.filterDate("2023-01-01", "2023-01-31")
//影像镶嵌和裁剪
var img = filtered
.mean()
.select([0, 1])
.clip(geometry)
//选择坐标系
var proj = filtered.first().select(0).projection()
//建立核函数
var circle_metres = ee.Kernel.circle({
radius: 100,
units: "meters",
magnitude: 2
})
// gsd 是 ~10 米,因此将其调整为 10 像素,以便与上述原生比例相当
var circle_pixels = ee.Kernel.circle({
radius: 10,
units: "pixels",
magnitude: 2
})
var circle_pixels_projected = ee.Kernel.circle({
radius: 10,
units: "pixels",
magnitude: 2
})
//按照核函数进行卷积
var img_m = img.convolve(circle_metres)
var img_p = img.convolve(circle_pixels)
var img_forced_res = img.convolve(circle_pixels_projected).reproject(proj.atScale(1))
var vis = {
"min": -26,
"max": 10,
"bands": ["VV", "VH", "VV"]
}
Map.centerObject(geometry2)
Map.addLayer(img, vis, "No Kernel Composite")
Map.addLayer(img_m, vis, "Circle Kernel (m)")
Map.addLayer(img_p, vis, "Circle Kernel (px)")
Map.addLayer(img_forced_res, vis, "Circle Kernel at 10m (px)")