إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
print
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض هذه الدالة الوسيطات في وحدة التحكّم.
الاستخدام | المرتجعات |
---|
print(var_args) | |
الوسيطة | النوع | التفاصيل |
---|
var_args | VarArgs<Object> | العناصر المطلوب طباعتها. |
أمثلة
محرّر الرموز البرمجية (JavaScript)
print(1); // 1
print(ee.Number(1)); // 1
print(ee.Array([1])); // [1]
print(ee.ImageCollection('AAFC/ACI').size()); // 10
print(ee.Image('AAFC/ACI/2009')); // Image AAFC/ACI/2009 (1 band)
print(ee.FeatureCollection("NOAA/NHC/HURDAT2/pacific").size()); // 28547
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
"""There is no dedicated print function for the Earth Engine Python API.
To print Earth Engine objects, use Python's built-in `print` function.
Printing an Earth Engine object in Python prints the serialized request for the
object, not the object itself, so you must call `getInfo()` on Earth Engine
objects to get the desired object from the server to the client. For example,
`print(ee.Number(1).getInfo())`. Note that `getInfo()` is a synchronous
operation. Alternatively, the eerepr library provides rich Earth Engine object
representation; it is included in the geemap library.
"""
print(1) # 1
print(ee.Number(1).getInfo()) # 1
print(ee.Array([1]).getInfo()) # [1]
print(ee.ImageCollection('AAFC/ACI').size().getInfo()) # 10
print(ee.Image('AAFC/ACI/2009').getInfo()) # Image AAFC/ACI/2009 (1 band)
print(
ee.FeatureCollection("NOAA/NHC/HURDAT2/pacific").size().getInfo()
) # 28547
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eprint()\u003c/code\u003e displays the provided arguments, including Earth Engine objects and standard data types, in the console.\u003c/p\u003e\n"],["\u003cp\u003eIn JavaScript, \u003ccode\u003eprint()\u003c/code\u003e directly displays Earth Engine objects, while in Python, you typically need to use \u003ccode\u003egetInfo()\u003c/code\u003e or the \u003ccode\u003eeerepr\u003c/code\u003e library for proper visualization.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts a variable number of arguments (\u003ccode\u003evar_args\u003c/code\u003e) representing the objects to be printed.\u003c/p\u003e\n"],["\u003cp\u003eExamples are provided demonstrating the usage of \u003ccode\u003eprint()\u003c/code\u003e with various Earth Engine objects like \u003ccode\u003eee.Number\u003c/code\u003e, \u003ccode\u003eee.Array\u003c/code\u003e, \u003ccode\u003eee.ImageCollection\u003c/code\u003e, and \u003ccode\u003eee.Image\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `print` function displays objects to the console. It accepts `VarArgs` as input. In JavaScript, `print(var_args)` directly outputs the object's value. In Python, the built-in `print` displays the serialized request for Earth Engine objects. To print the object's value in Python, `.getInfo()` is needed, which synchronously retrieves the object from the server, as in `print(ee.Number(1).getInfo())`. Example cases are shown for numbers, arrays, and image collections.\n"],null,["# print\n\n\u003cbr /\u003e\n\nPrints the arguments to the console.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------|---------|\n| `print(var_args)` | |\n\n| Argument | Type | Details |\n|------------|-------------------|-----------------------|\n| `var_args` | VarArgs\\\u003cObject\\\u003e | The objects to print. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint(1); // 1\nprint(ee.Number(1)); // 1\nprint(ee.Array([1])); // [1]\n\nprint(ee.ImageCollection('AAFC/ACI').size()); // 10\nprint(ee.Image('AAFC/ACI/2009')); // Image AAFC/ACI/2009 (1 band)\n\nprint(ee.FeatureCollection(\"NOAA/NHC/HURDAT2/pacific\").size()); // 28547\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\"\"\"There is no dedicated print function for the Earth Engine Python API.\nTo print Earth Engine objects, use Python's built-in `print` function.\nPrinting an Earth Engine object in Python prints the serialized request for the\nobject, not the object itself, so you must call `getInfo()` on Earth Engine\nobjects to get the desired object from the server to the client. For example,\n`print(ee.Number(1).getInfo())`. Note that `getInfo()` is a synchronous\noperation. Alternatively, the eerepr library provides rich Earth Engine object\nrepresentation; it is included in the geemap library.\n\"\"\"\n\nprint(1) # 1\nprint(ee.Number(1).getInfo()) # 1\nprint(ee.Array([1]).getInfo()) # [1]\n\nprint(ee.ImageCollection('AAFC/ACI').size().getInfo()) # 10\nprint(ee.Image('AAFC/ACI/2009').getInfo()) # Image AAFC/ACI/2009 (1 band)\n\nprint(\n ee.FeatureCollection(\"NOAA/NHC/HURDAT2/pacific\").size().getInfo()\n) # 28547\n```"]]