希望您一切都好!
我正在尝试使用聚焦函数求和栅格值来求和一个核圆,但是刚刚发现帽子中没有class Timer {
// Automatically starts the timer
constructor(name = 'Benchmark') {
this.NS_PER_SEC = 1e9;
this.MS_PER_NS = 1e-6
this.name = name;
this.startTime = process.hrtime();
}
// returns the time in ms since instantiation
// can be called multiple times
runtimeMs() {
const diff = process.hrtime(this.startTime);
return (diff[0] * this.NS_PER_SEC + diff[1]) * this.MS_PER_NS;
}
// retuns a string: the time in ms since instantiation
runtimeMsStr() {
return `${this.name} took ${this.runtimeMs()} milliseconds`;
}
}
,正如我所期望的那样。
相反,我发现了focus_ *:最大值,最小值,平均值,中位数和众数,估计值。
有没有求和函数的原因吗?
怎么可能得到这个估计?
预先感谢。
答案 0 :(得分:0)
您可以使用“ image.reduceNeighborhood()”选项,请参见此处(https://developers.google.com/earth-engine/reducers_reduce_neighborhood)
// Compute sum over round kernel
var result = imgage.reduceNeighborhood({
reducer: ee.Reducer.sum(),
kernel: ee.Kernel.circle(7),
});