GEE 问题:超限中对于besteffort的使用到底行不行?
目录
问题
函数
reduceRegion(reducer, geometry, scale, crs, crsTransform, bestEffort, maxPixels, tileScale)
Arguments:
Returns: Dictionary
解答
代码
问题
我正在尝试优化地球地图中的区域统计数据,并且在减少区域时使用bestEffort有一些疑问:
1.如果要分析的区域包含的像素少于 maxPixels 上设置的像素,bestEffort 是否会在分析中改变任何东西?
不
2.我读到 bestEffort 还可以简化用于简化的多边形。这是真的吗?它们是如何简化的?我们可以控制吗?
这不是真的。文档中没有提到它会简化多边形。如果确实如此,最好将其添加到文档中。如果您在文档中的某个地方读到它,请在此处分享链接。
3.如果设置 bestEffort:true,即使我想要缩小的区域小于 maxPixels,是否会出现性能问题? 相关 1
不
4.最后,非常重要的一点是,如果像素数确实高于 maxPixels,那么有什么方法可以知道在什么比例下进行缩减?另外,您能否分享用于计算像素数的代码,以便我们可以使用它来添加我们实际用于分析的像素比例信息。最好的解决方案是,如果可以在 reduceRegion 返回的字典中返回分析的比例,即总和缩减:
{
“总和”:454564564564,“原始比例” :10,
“实际比例”:355
}
函数
reduceRegion(reducer, geometry, scale, crs, crsTransform, bestEffort, maxPixels, tileScale)
Apply a reducer to all the pixels in a specific region.
Either the reducer must have the same number of inputs as the input image has bands, or it must have a single input and will be repeated for each band.
Returns a dictionary of the reducer's outputs.
Arguments:
this:image (Image):
The image to reduce.
reducer (Reducer):
The reducer to apply.
geometry (Geometry, default: null):
The region over which to reduce data. Defaults to the footprint of the image's first band.
scale (Float, default: null):
A nominal scale in meters of the projection to work in.
crs (Projection, default: null):
The projection to work in. If unspecified, the projection of the image's first band is used. If specified in addition to scale, rescaled to the specified scale.
crsTransform (List, default: null):
The list of CRS transform values. This is a row-major ordering of the 3x2 transform matri