公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.FeatureCollection.bounds
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
围绕集合中的几何图形构建一个边界框。
用法 | 返回 |
---|
FeatureCollection.bounds(maxError, proj) | 几何图形 |
参数 | 类型 | 详细信息 |
---|
此:collection | FeatureCollection | 要构建边界的集合。 |
maxError | ErrorMargin,可选 | 执行任何必要的重新投影时可容忍的最大误差量。 |
proj | 投影,可选 | 如果指定了此参数,结果将采用此投影。否则,它将采用 EPSG:4326。 |
示例
代码编辑器 (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
print('Bounds of Belgium power plants:', fc.bounds()); // ee.Geometry
Python 设置
如需了解 Python API 和如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
import ee
import geemap.core as geemap
Colab (Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
print('Bounds of Belgium power plants:', fc.bounds().getInfo()) # ee.Geometry
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003ebounds()\u003c/code\u003e method calculates the bounding box of all geometries within a FeatureCollection.\u003c/p\u003e\n"],["\u003cp\u003eYou can optionally specify a \u003ccode\u003emaxError\u003c/code\u003e to control reprojection accuracy, and a \u003ccode\u003eproj\u003c/code\u003e to determine the projection of the resulting bounding box.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting bounding box is returned as a Geometry object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFeatureCollection.bounds()\u003c/code\u003e method can be called directly on a feature collection instance to determine the area encompassed by all the included features.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.bounds\n\nConstructs a bounding box around the geometries in a collection.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------|----------|\n| FeatureCollection.bounds`(`*maxError* `, `*proj*`)` | Geometry |\n\n| Argument | Type | Details |\n|--------------------|-----------------------|-----------------------------------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The collection whose bounds will be constructed. |\n| `maxError` | ErrorMargin, optional | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `proj` | Projection, optional | If specified, the result will be in this projection. Otherwise it will be in EPSG:4326. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// FeatureCollection of power plants in Belgium.\nvar fc = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\n\nprint('Bounds of Belgium power plants:', fc.bounds()); // ee.Geometry\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# FeatureCollection of power plants in Belgium.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\nprint('Bounds of Belgium power plants:', fc.bounds().getInfo()) # ee.Geometry\n```"]]