ee.data.computeFeatures (Python only)
Computes a list of features by applying a computation to features.
Returns:
A list of GeoJSON features reprojected to EPSG:4326 with planar edges.
Usage | Returns |
ee.data.computeFeatures(params) | List |
Argument | Type | Details |
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. |
Examples
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
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...
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-03 UTC.
[null,null,["Last updated 2024-06-03 UTC."],[[["`ee.data.computeFeatures` applies a computation to features and returns a list of GeoJSON features."],["The returned features are reprojected to EPSG:4326 and have planar edges."],["`ee.data.computeFeatures` accepts parameters like expression, pageSize, fileFormat, pageToken, and workloadTag."],["Example code demonstrates using `ee.data.computeFeatures` to extract image band values for a point location over a time series and convert an ImageCollection to a FeatureCollection."]]],[]]