AI-generated Key Takeaways
-
The
evaluatemethod asynchronously retrieves the value of aComputedObjectfrom the server and passes it to a provided callback function. -
The
callbackfunction receives the result upon success or an error message upon failure. -
The example demonstrates using
evaluatewith a JavaScriptcomputedGeometryto print its GeoJSON string representation asynchronously. -
The Python API does not have an
evaluatemethod foree.Geometryand suggests usinggetInfo()instead.
| Usage | Returns |
|---|---|
Geometry.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)
// Define a callback function that prints a GeoJSON string. var printGeoJSONString = function(geometry) { geometry = ee.Geometry(geometry); print(geometry.toGeoJSONString()); }; // Create a simple computed geometry. var computedGeometry = ee.Geometry.Point(0, 0).buffer(10); // Evaluate the callback function that asynchronously retrieves and prints // the GeoJSON string representation of computed geometry. computedGeometry.evaluate(printGeoJSONString);
import ee import geemap.core as geemap
Colab (Python)
# The Earth Engine Python client library does not have an evaluate method for # asynchronous evaluation of ee.Geometry objects. # Use ee.Geometry.getInfo() instead.