公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.data.computeFeatures (Python only)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过对特征应用计算来计算特征列表。
返回:
重新投影到 EPSG:4326 并带有平面边的 GeoJSON 要素列表。
用法 | 返回 |
ee.data.computeFeatures(params) | 列表 |
参数 | 类型 | 详细信息 |
params | 对象 | 一个包含参数的对象,参数可具有以下可能的值:
expression - 要计算的表达式。
pageSize - 每页的结果数上限。服务器返回的图片数量可能少于请求的数量。如果未指定,则默认页面大小为每页 1000 条结果。
fileFormat - 如果存在,则指定表格数据的输出格式。该函数会为每个网页发出网络请求,直到提取整个表为止。提取次数取决于表中的行数和 pageSize 。
系统会忽略 pageToken 。支持的格式包括:
PANDAS_DATAFRAME (适用于 Pandas DataFrame)和
GEOPANDAS_GEODATAFRAME (适用于 GeoPandas GeoDataFrame)。
pageToken - 标识服务器应返回的结果页面的令牌。
workloadTag - 用户提供的用于跟踪相应计算的标记。 |
示例
Python 设置
如需了解 Python API 和如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
# Region of interest.
pt = ee.Geometry.Point([-122.0679107870136, 36.983302098145906])
# Imagery of interest.
images = (ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
.filterBounds(pt).filterDate('2021-01-01', '2021-12-31'))
def point_overlay(image):
"""Extracts image band values for pixel-point intersection."""
return ee.Feature(pt, image.reduceRegion('first', pt, 30))
# Convert an ImageCollection to a FeatureCollection.
features = images.map(point_overlay)
features_dict = ee.data.computeFeatures({'expression': features})
pprint(features_dict)
# Do something with the features...
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eee.data.computeFeatures\u003c/code\u003e applies a computation to features and returns a list of GeoJSON features.\u003c/p\u003e\n"],["\u003cp\u003eThe returned features are reprojected to EPSG:4326 and have planar edges.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eee.data.computeFeatures\u003c/code\u003e accepts parameters like expression, pageSize, fileFormat, pageToken, and workloadTag.\u003c/p\u003e\n"],["\u003cp\u003eExample code demonstrates using \u003ccode\u003eee.data.computeFeatures\u003c/code\u003e to extract image band values for a point location over a time series and convert an ImageCollection to a FeatureCollection.\u003c/p\u003e\n"]]],["The `ee.data.computeFeatures` function computes and returns a list of GeoJSON features, reprojected to EPSG:4326. It applies a user-defined computation (specified in the `expression` parameter) to features. Key parameters include `pageSize` for controlling results per page, `fileFormat` for specifying tabular output formats like Pandas or GeoPandas DataFrames, `pageToken` for paginated results, and `workloadTag` for computation tracking. The provided example demonstrates extracting band values from an `ImageCollection` using a point's intersection.\n"],null,["# ee.data.computeFeatures (Python only)\n\n\u003cbr /\u003e\n\nComputes a list of features by applying a computation to features.\n\n\u003cbr /\u003e\n\nReturns:\nA list of GeoJSON features reprojected to EPSG:4326 with planar edges.\n\n| Usage | Returns |\n|-----------------------------------|---------|\n| `ee.data.computeFeatures(params)` | List |\n\n| Argument | Type | Details |\n|----------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `params` | Object | An object containing parameters with the following possible values: `expression` - The expression to compute. `pageSize` - The maximum number of results per page. The server may return fewer images than requested. If unspecified, the page size default is 1000 results per page. `fileFormat` - If present, specifies an output format for the tabular data. The function makes a network request for each page until the entire table has been fetched. The number of fetches depends on the number of rows in the table and `pageSize`. `pageToken` is ignored. Supported formats are: `PANDAS_DATAFRAME` for a Pandas DataFrame and `GEOPANDAS_GEODATAFRAME` for a GeoPandas GeoDataFrame. `pageToken` - A token identifying a page of results the server should return. `workloadTag` - User supplied tag to track this computation. |\n\nExamples\n--------\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\nfrom pprint import pprint\n\n# Region of interest.\npt = ee.Geometry.Point([-122.0679107870136, 36.983302098145906])\n# Imagery of interest.\nimages = (ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')\n .filterBounds(pt).filterDate('2021-01-01', '2021-12-31'))\n\ndef point_overlay(image):\n \"\"\"Extracts image band values for pixel-point intersection.\"\"\"\n return ee.Feature(pt, image.reduceRegion('first', pt, 30))\n\n# Convert an ImageCollection to a FeatureCollection.\nfeatures = images.map(point_overlay)\n\nfeatures_dict = ee.data.computeFeatures({'expression': features})\n\npprint(features_dict)\n# Do something with the features...\n```"]]