إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.Geometry.evaluate
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يستردّ بشكل غير متزامن قيمة هذا العنصر من الخادم ويمرّرها إلى دالة رد الاتصال المقدَّمة.
الاستخدام | المرتجعات |
---|
Geometry.evaluate(callback) | |
الوسيطة | النوع | التفاصيل |
---|
هذا: computedobject | ComputedObject | مثيل ComputedObject |
callback | الوظيفة | دالة بالصيغة function(success, failure)، يتم استدعاؤها عندما يعرض الخادم إجابة. إذا كان الطلب ناجحًا، يحتوي وسيط النجاح على النتيجة التي تم تقييمها. في حال تعذّر تنفيذ الطلب، ستتضمّن وسيطة الفشل رسالة خطأ. |
أمثلة
محرّر الرموز البرمجية (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);
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
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.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eGeometry.evaluate\u003c/code\u003e is a method used to asynchronously retrieve the value of a ComputedObject (like a Geometry) from the server.\u003c/p\u003e\n"],["\u003cp\u003eIt takes a callback function as an argument, which is executed upon receiving the server response, providing either the evaluated result or an error message.\u003c/p\u003e\n"],["\u003cp\u003eThe example demonstrates using \u003ccode\u003eGeometry.evaluate\u003c/code\u003e with a callback function to print the GeoJSON representation of a computed geometry.\u003c/p\u003e\n"],["\u003cp\u003eWhile the JavaScript example showcases \u003ccode\u003eGeometry.evaluate\u003c/code\u003e, the Python library uses \u003ccode\u003eGeometry.getInfo()\u003c/code\u003e for similar functionality.\u003c/p\u003e\n"]]],["The `evaluate` method asynchronously retrieves a `ComputedObject`'s value from the server and provides it to a callback function. The callback receives a success or failure argument, with the result or error message, respectively. The example in javascript shows how it is used with a `GeoJSON` string to display the result. In python, there is not an `evaluate` method, instead you have to use the `getInfo()` method.\n"],null,["# ee.Geometry.evaluate\n\n\u003cbr /\u003e\n\nAsynchronously retrieves the value of this object from the server and passes it to the provided callback function.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------|---------|\n| Geometry.evaluate`(callback)` | |\n\n| Argument | Type | Details |\n|------------------------|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `computedobject` | ComputedObject | The ComputedObject instance. |\n| `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. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Define a callback function that prints a GeoJSON string.\nvar printGeoJSONString = function(geometry) {\n geometry = ee.Geometry(geometry);\n print(geometry.toGeoJSONString());\n};\n\n// Create a simple computed geometry.\nvar computedGeometry = ee.Geometry.Point(0, 0).buffer(10);\n\n// Evaluate the callback function that asynchronously retrieves and prints\n// the GeoJSON string representation of computed geometry.\ncomputedGeometry.evaluate(printGeoJSONString);\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# The Earth Engine Python client library does not have an evaluate method for\n# asynchronous evaluation of ee.Geometry objects.\n# Use ee.Geometry.getInfo() instead.\n```"]]