إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.Array.identity
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تنشئ مصفوفة متطابقة ثنائية الأبعاد بالحجم المحدّد.
الاستخدام | المرتجعات |
---|
ee.Array.identity(size) | مصفوفة |
الوسيطة | النوع | التفاصيل |
---|
size | عدد صحيح | طول كل محور |
أمثلة
محرّر الرموز البرمجية (JavaScript)
// []
print(ee.Array.identity(0));
// [[1]]
print(ee.Array.identity(1));
// [[1,0],
// [0,1]]
print(ee.Array.identity(2));
// [[1,0,0],
// [0,1,0],
// [0,0,1]]
print(ee.Array.identity(3));
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
# []
display(ee.Array.identity(0))
# [[1]]
display(ee.Array.identity(1))
# [[1, 0],
# [0, 1]]
display(ee.Array.identity(2))
# [[1, 0, 0],
# [0, 1, 0],
# [0, 0, 1]]
display(ee.Array.identity(3))
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eee.Array.identity()\u003c/code\u003e generates a 2-dimensional identity matrix (a square matrix with 1s on the main diagonal and 0s elsewhere) with a specified size.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esize\u003c/code\u003e argument determines the dimensions of the matrix, representing the length of each axis.\u003c/p\u003e\n"],["\u003cp\u003eAn identity matrix with a size of 0 results in an empty array (\u003ccode\u003e[]\u003c/code\u003e), while sizes of 1, 2, and 3 create identity matrices of corresponding dimensions as shown in the examples.\u003c/p\u003e\n"]]],[],null,["# ee.Array.identity\n\nCreates a 2D identity matrix of the given size.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------|---------|\n| `ee.Array.identity(size)` | Array |\n\n| Argument | Type | Details |\n|----------|---------|--------------------------|\n| `size` | Integer | The length of each axis. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// []\nprint(ee.Array.identity(0));\n\n// [[1]]\nprint(ee.Array.identity(1));\n\n// [[1,0],\n// [0,1]]\nprint(ee.Array.identity(2));\n\n// [[1,0,0],\n// [0,1,0],\n// [0,0,1]]\nprint(ee.Array.identity(3));\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# []\ndisplay(ee.Array.identity(0))\n\n# [[1]]\ndisplay(ee.Array.identity(1))\n\n# [[1, 0],\n# [0, 1]]\ndisplay(ee.Array.identity(2))\n\n# [[1, 0, 0],\n# [0, 1, 0],\n# [0, 0, 1]]\ndisplay(ee.Array.identity(3))\n```"]]