MCPcopy
hub / github.com/google/earthengine-api / computeFeatures

Function computeFeatures

python/ee/data.py:942–985  ·  view source on GitHub ↗

Computes a list of features by applying a computation to features. Args: params: 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 ima

(params: dict[str, Any])

Source from the content-addressed store, hash-verified

940
941
942def computeFeatures(params: dict[str, Any]) -> Any:
943 """Computes a list of features by applying a computation to features.
944
945 Args:
946 params: An object containing parameters with the following possible values:
947 expression - The expression to compute.
948 pageSize - The maximum number of results per page. The server may return
949 fewer images than requested. If unspecified, the page size default is
950 1000 results per page.
951 pageToken - A token identifying a page of results the server should
952 return.
953 fileFormat - If present, specifies an output format for the tabular data.
954 The function makes a network request for each page until the entire
955 table has been fetched. The number of fetches depends on the number of
956 rows in the table and pageSize. pageToken is ignored. Supported
957 formats are: PANDAS_DATAFRAME for a Pandas DataFrame and
958 GEOPANDAS_GEODATAFRAME for a GeoPandas GeoDataFrame.
959 workloadTag - User supplied tag to track this computation.
960
961 Returns:
962 A Pandas DataFrame, GeoPandas GeoDataFrame, or a dictionary containing:
963 - "type": always "FeatureCollection" marking this object as a GeoJSON
964 feature collection.
965 - "features": a list of GeoJSON features reprojected to EPSG:4326 with
966 planar edges.
967 - "next_page_token": A token to retrieve the next page of results in a
968 subsequent call to this function.
969 """
970 params = params.copy()
971 params['expression'] = serializer.encode(params['expression'])
972 _maybe_populate_workload_tag(params)
973
974 def call(params):
975 return _execute_cloud_call(
976 _get_cloud_projects()
977 .table()
978 .computeFeatures(project=_get_projects_path(), body=params)
979 )
980
981 converter = _extract_table_converter(params)
982 params.pop('fileFormat', None)
983 if converter:
984 return converter.do_conversion(_generate(call, 'features', params=params))
985 return call(params)
986
987
988def getTileUrl(mapid: dict[str, Any], x: float, y: float, z: float) -> str:

Callers

nothing calls this directly

Calls 6

_extract_table_converterFunction · 0.85
_generateFunction · 0.85
callFunction · 0.70
encodeMethod · 0.45
do_conversionMethod · 0.45

Tested by

no test coverage detected