إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
التنفيذ المؤجَّل
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح مستند الاختلاف بين العميل والخادم كيف يمكن أن تكون العناصر المُشار إليها
في النص البرمجي من جهة العميل أو الخادم. لا يحتوي النص البرمجي الكامل
على العناصر التي تريد استخدامها فقط، بل يحتوي أيضًا على مجموعة من التعليمات التي تُعلِم Earth Engine
كيفية التعامل معها. يوضّح هذا المستند كيفية إرسال هذه التعليمات إلى Google لمعالجتها، وكيفية إعادة إرسال النتائج إلى العميل لعرضها.
عند كتابة نص برمجي في Earth Engine (سواءً كان JavaScript أو Python)، لا يتم
تشغيل هذا الرمز البرمجي مباشرةً على خوادم Earth Engine في Google. بدلاً من ذلك، تُشفِّر
مكتبة العميل النص البرمجي
إلى مجموعة من عناصر JSON، وتُرسِل العناصر
إلى Google وتنتظر الردّ. يمثّل كل عنصر مجموعة من العمليات
المطلوبة للحصول على ناتج معيّن، مثل صورة لعرضها في العميل.
راجِع الرمز البرمجي التالي:
محرِّر الرموز البرمجية (JavaScript)
var image = ee.Image('CGIAR/SRTM90_V4');
var operation = image.add(10);
print(operation.toString());
print(operation);
إعداد لغة Python
اطّلِع على صفحة
بيئة Python للحصول على معلومات عن واجهة برمجة التطبيقات Python API واستخدام IDE
geemap
لتطوير التطبيقات التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
image = ee.Image('CGIAR/SRTM90_V4')
operation = image.add(10)
print(operation)
print(operation.getInfo())
سيؤدي بيان الطباعة الأول إلى عرض بنية JSON التي تستخدمها مكتبة العميل
لوصف هذه الصورة للخادم في Google:
ee.Image({
"type": "Invocation",
"arguments": {
"image1": {
"type": "Invocation",
"arguments": {
"id": "CGIAR/SRTM90_V4"
},
"functionName": "Image.load"
},
"image2": {
"type": "Invocation",
"arguments": {
"value": 10
},
"functionName": "Image.constant"
}
},
"functionName": "Image.add"
})
سيُرسِل بيان الطباعة الثاني الطلب إلى Google ويعرض ردّ POST من خوادم Google. للاطّلاع على الاستجابة بتنسيق JSON بالكامل، انقر على رابط JSON
على يسار وحدة التحكّم بجانب العنصر المطبوع:
{
"type": "Image",
"bands": [
{
"id": "elevation",
"data_type": {
"type": "PixelType",
"precision": "int",
"min": -32758,
"max": 32777
},
"crs": "EPSG:4326",
"crs_transform": [
0.0008333333535119891,
0,
-180,
0,
-0.0008333333535119891,
60
]
}
]
}
لا يتم إرسال أي بيانات إلى Google لمعالجتها إلا بعد تلقّي طلب بذلك. في هذا
المثال، يؤدي طباعة نتيجة طلب getInfo()
على عنصر خادم إلى بدء طلب. ولا تتم أي معالجة على الخادم إلى أن يتم طلب هذه النتيجة
صراحةً. يُرجى العِلم أنّ print()
في "محرر رموز JavaScript" هي دالة خاصة
من جهة العميل تُغلِّف طلب getInfo()
غير متزامن. أمّا في Python، فندعوها
مباشرةً.
مثال آخر على طلب شيء ما هو عرضه في "محرر الرموز" أو عنصر خريطة geemap. عند إرسال هذا الطلب إلى Google، لا يتم عرض سوى المربّعات
اللازمة لعرض النتيجة في "محرر الرموز" أو عنصر خريطة geemap.
على وجه التحديد، يحدّد موضع الخريطة ومستوى التكبير أو التصغير البيانات التي تتم معالجتها
وتحويلها إلى صور يمكن عرضها على الخريطة. في حال تم التمرير أو التصغير/التكبير، يُرجى العِلم أنّه
يتم احتساب المربّعات الأخرى بشكلٍ بطيء. يتيح هذا النظام عند الطلب إجراء العمليات بالتوازي وبكفاءة، ولكنه يعني أيضًا أنّ الصورة المعروضة على الخريطة يتم إنشاؤها من inputs مختلفة استنادًا إلى مستوى التكبير وموقع حدود الخريطة. اطّلِع على مزيد من المعلومات عن
كيفية تحديد مدخلات العملية الحسابية من الطلب في مستند
Scale.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eEarth Engine code execution involves encoding scripts into JSON objects by the client library and sending them to Google servers for processing, with results returned to the client for display.\u003c/p\u003e\n"],["\u003cp\u003eProcessing on Google servers is triggered only when there's an explicit request, such as printing an object's information or displaying it on a map.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine employs a lazy processing system where only the necessary data for the current view is computed, improving efficiency and allowing for parallelization.\u003c/p\u003e\n"],["\u003cp\u003eThe displayed image on the map depends on the zoom level and map bounds, resulting in different inputs being used for computation at various scales.\u003c/p\u003e\n"],["\u003cp\u003eFurther details on how inputs are determined for computations based on requests can be found in the Scale documentation.\u003c/p\u003e\n"]]],[],null,["# Deferred Execution\n\nThe [Client vs. Server](/earth-engine/guides/client_server) doc describes how objects referenced\nin your script can be either client-side or server-side. The complete script contains\nnot only the objects you want to use, but also a set of instructions that tell Earth Engine\nwhat to do with them. This doc describes how those instructions are sent to Google for\nprocessing and how the results are sent back to the client for display.\n\nWhen you write a script in Earth Engine (either JavaScript or Python), that code does\nNOT run directly on Earth Engine servers at Google. Instead, the\n[client library](https://github.com/google/earthengine-api) encodes the\nscript into a set of [JSON](http://www.json.org/) objects, sends the objects\nto Google and waits for a response. Each object represents a set of operations\nrequired to get a particular output, an image to display in the client, for example.\nConsider the following code:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar image = ee.Image('CGIAR/SRTM90_V4');\nvar operation = image.add(10);\nprint(operation.toString());\nprint(operation);\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\nimage = ee.Image('CGIAR/SRTM90_V4')\noperation = image.add(10)\nprint(operation)\nprint(operation.getInfo())\n```\n\nThe first print statement will output the JSON structure that the client library\nuses to describe that image to the server at Google: \n\n```gdscript\nee.Image({\n \"type\": \"Invocation\",\n \"arguments\": {\n \"image1\": {\n \"type\": \"Invocation\",\n \"arguments\": {\n \"id\": \"CGIAR/SRTM90_V4\"\n },\n \"functionName\": \"Image.load\"\n },\n \"image2\": {\n \"type\": \"Invocation\",\n \"arguments\": {\n \"value\": 10\n },\n \"functionName\": \"Image.constant\"\n }\n },\n \"functionName\": \"Image.add\"\n})\n \n```\n\nThe second print statement will send the request to Google and output the\n[POST](https://en.wikipedia.org/wiki/POST_(HTTP)) response from Google\nservers. To see the response in all its JSON glory, click the `JSON` link\non the right side of the console, next to the printed object: \n\n```carbon\n{\n \"type\": \"Image\",\n \"bands\": [\n {\n \"id\": \"elevation\",\n \"data_type\": {\n \"type\": \"PixelType\",\n \"precision\": \"int\",\n \"min\": -32758,\n \"max\": 32777\n },\n \"crs\": \"EPSG:4326\",\n \"crs_transform\": [\n 0.0008333333535119891,\n 0,\n -180,\n 0,\n -0.0008333333535119891,\n 60\n ]\n }\n ]\n}\n \n```\n\nNothing is sent to Google for processing until there is a request for it. In this\nexample, printing the result of a `getInfo()` call on a server object triggers a\nrequest. No processing is done on the server until that result is explicitly\nrequested. Note that `print()` in the JavaScript Code Editor is a special\nclient-side function that wraps an asynchronous `getInfo()` call; for Python we\ncall it directly.\n\nAnother example of requesting something is displaying it on the Code Editor or geemap map\nelement. When this request is sent to Google, only the tiles\nnecessary to display the result in the Code Editor or geemap map element are returned.\nSpecifically, the position of the map and the zoom level determine which data get processed\nand turned into images that can be displayed on the map. If you pan or zoom, note that\nother tiles are computed lazily. This on-demand system allows for parallelization and\nefficient processing, but also means that the image displayed on the map is produced from\ndifferent inputs depending on the zoom level and location of the map bounds. Learn more about\nhow inputs to a computation are determined from the request in the\n[Scale](/earth-engine/guides/scale) doc."]]