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...