Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.

ee.Geometry.evaluate

  • Theevaluate method asynchronously retrieves the value of aComputedObject from the server and passes it to a provided callback function.

  • Thecallback function receives the result upon success or an error message upon failure.

  • The example demonstrates usingevaluate with a JavaScriptcomputedGeometry to print its GeoJSON string representation asynchronously.

  • The Python API does not have anevaluate method foree.Geometry and suggests usinggetInfo() instead.

Asynchronously retrieves the value of this object from the server and passes it to the provided callback function.

UsageReturns
Geometry.evaluate(callback)
ArgumentTypeDetails
this:computedobjectComputedObjectThe ComputedObject instance.
callbackFunctionA 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.varprintGeoJSONString=function(geometry){geometry=ee.Geometry(geometry);print(geometry.toGeoJSONString());};// Create a simple computed geometry.varcomputedGeometry=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);

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.Geometry objects.# Use ee.Geometry.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.