ee.Dictionary.evaluate Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
Dictionary.evaluatemethod asynchronously retrieves the value of a dictionary object from the server and passes it to a callback function.The callback function is executed when the server returns an answer, with the success argument containing the evaluated result on success and the failure argument containing an error message on failure.
In JavaScript,
dictServer.evaluatecan be used to transfer a server-side dictionary to the client for client-side operations.The Earth Engine Python client library does not have an
evaluatemethod for asynchronous evaluation; instead,ee.Dictionary.getInfo()should be used.
| Usage | Returns |
|---|---|
Dictionary.evaluate(callback) |
| Argument | Type | Details |
|---|---|---|
this:computedobject | ComputedObject | The ComputedObject instance. |
callback | Function | A function of the form function(success, failure), called when the server returns an answer. If the request succeeded, the success argument contains the evaluated result. If the request failed, the failure argument will contains an error message. |
Examples
Code Editor (JavaScript)
// A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).vardictServer=ee.Dictionary({B1:182,B2:219,B3:443});// Use evaluate to transfer server-side dictionary to the client.dictServer.evaluate(function(dictClient){print('Client-side dot notation to access "B1" value',dictClient.B1);print('Client-side bracket notation to access "B1" value',dictClient['B1']);print('Client-side operations to print all key-value pairs');Object.keys(dictClient).forEach(function(key){print(' '+key+': '+dictClient[key]);});});
Python setup
See the Python Environment page for information on the Python API and usinggeemap for interactive development.
importeeimportgeemap.coreasgeemap
Colab (Python)
# The Earth Engine Python client library does not have an evaluate method for# asynchronous evaluation of ee.Dictionary objects.# Use ee.Dictionary.getInfo() instead.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.