Earth Engine 将推出
非商业配额层级,以保护共享计算资源并确保为所有人提供可靠的性能。所有非商业项目都需要在
2026 年 4 月 27 日之前选择配额层级,否则系统会默认使用 Community 层级。层级配额将于
2026 年 4 月 27 日对所有项目生效(无论层级选择日期如何)。
了解详情。
ee.Geometry.MultiPoint.simplify
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将几何图形简化到给定的误差范围内。请注意,除非明确将 maxError 指定为 null,否则此算法不会遵循其使用方请求的误差范围。
这会替换 Earth Engine 传播误差范围的默认政策,因此无论从输出中请求的几何图形准确度如何,系统都会使用此算法的实参中指定的误差范围来请求输入。这样一来,渲染的矢量地图在所有缩放级别下都会保持一致的渲染效果,但在较低的缩放级别(即缩小)下,几何图形不会被简化,这可能会损害性能。
| 用法 | 返回 |
|---|
MultiPoint.simplify(maxError, proj) | 几何图形 |
| 参数 | 类型 | 详细信息 |
|---|
this:geometry | 几何图形 | 要简化的几何图形。 |
maxError | ErrorMargin | 结果与输入之间可能存在的最大误差量。 |
proj | 投影,默认值:null | 如果指定,结果将采用此投影。否则,结果将采用与输入相同的投影。如果误差范围采用投影单位,则该范围将被解读为此投影的单位。 |
示例
代码编辑器 (JavaScript)
// Define a MultiPoint object.
var multiPoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]]);
// Apply the simplify method to the MultiPoint object.
var multiPointSimplify = multiPoint.simplify({'maxError': 1});
// Print the result to the console.
print('multiPoint.simplify(...) =', multiPointSimplify);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(multiPoint,
{'color': 'black'},
'Geometry [black]: multiPoint');
Map.addLayer(multiPointSimplify,
{'color': 'red'},
'Result [red]: multiPoint.simplify');
Python 设置
如需了解 Python API 和如何使用
geemap 进行交互式开发,请访问
Python 环境页面。
import ee
import geemap.core as geemap
Colab (Python)
# Define a MultiPoint object.
multipoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]])
# Apply the simplify method to the MultiPoint object.
multipoint_simplify = multipoint.simplify(maxError=1)
# Print the result.
display('multipoint.simplify(...) =', multipoint_simplify)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(multipoint, {'color': 'black'}, 'Geometry [black]: multipoint')
m.add_layer(
multipoint_simplify, {'color': 'red'}, 'Result [red]: multipoint.simplify'
)
m
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-04-20。
[null,null,["最后更新时间 (UTC):2026-04-20。"],[],[]]