公告:凡是在
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 - User supplied tag to track this computation. |
範例
Python 設定
請參閱
Python 環境頁面,瞭解 Python API 和如何使用 geemap
進行互動式開發。
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...
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間: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```"]]