お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.Array.add
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
要素ごとに、最初の値を 2 番目の値に加算します。
引数 | タイプ | 詳細 |
---|
これ: left | 配列 | 左側の値。 |
right | 配列 | 右側の値。 |
例
コードエディタ(JavaScript)
var empty = ee.Array([], ee.PixelType.int8());
print(empty.add(empty)); // []
print(ee.Array([0]).add(1)); // [1]
print(ee.Array([1]).add([2])); // [3]
print(ee.Array([-3]).add([-4])); // [-7]
print(ee.Array([5, 6]).add([7, 8])); // [12,14]
var array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]]);
print(array2x3.add(1)); // [[1,2,3],[4,5,6]]
print(array2x3.add(array2x3)); // [[0,2,4],[6,8,10]]
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
empty = ee.Array([], ee.PixelType.int8())
display(empty.add(empty)) # []
display(ee.Array([0]).add(1)) # [1]
display(ee.Array([1]).add([2])) # [3]
display(ee.Array([-3]).add([-4])) # [-7]
display(ee.Array([5, 6]).add([7, 8])) # [12 ,14]
array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]])
display(array2x3.add(1)) # [[1, 2 ,3], [4, 5, 6]]
display(array2x3.add(array2x3)) # [[0, 2, 4], [6, 8, 10]]
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003eArray.add()\u003c/code\u003e performs element-wise addition, adding the corresponding elements of two arrays or an array and a scalar.\u003c/p\u003e\n"],["\u003cp\u003eThe method returns a new array with the results of the addition.\u003c/p\u003e\n"],["\u003cp\u003eIt supports both single values and multi-dimensional arrays as input.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArray.add()\u003c/code\u003e can be used with both server-side objects (like Images) and client-side objects (like Lists).\u003c/p\u003e\n"]]],["The `Array.add(right)` function performs element-wise addition between two arrays. The left-hand array is added to the right-hand array or value, returning a new array. It supports adding a scalar value to an array or adding two arrays of the same dimensions. Examples show how an empty array added to itself returns an empty array, single element arrays added to a scalar or array, as well as multi-element and multi-dimensional array addition.\n"],null,["# ee.Array.add\n\nOn an element-wise basis, adds the first value to the second.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------|---------|\n| Array.add`(right)` | Array |\n\n| Argument | Type | Details |\n|--------------|-------|-----------------------|\n| this: `left` | Array | The left-hand value. |\n| `right` | Array | The right-hand value. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nvar empty = ee.Array([], ee.PixelType.int8());\nprint(empty.add(empty)); // []\n\nprint(ee.Array([0]).add(1)); // [1]\nprint(ee.Array([1]).add([2])); // [3]\nprint(ee.Array([-3]).add([-4])); // [-7]\n\nprint(ee.Array([5, 6]).add([7, 8])); // [12,14]\n\nvar array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]]);\nprint(array2x3.add(1)); // [[1,2,3],[4,5,6]]\nprint(array2x3.add(array2x3)); // [[0,2,4],[6,8,10]]\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\nempty = ee.Array([], ee.PixelType.int8())\ndisplay(empty.add(empty)) # []\n\ndisplay(ee.Array([0]).add(1)) # [1]\ndisplay(ee.Array([1]).add([2])) # [3]\ndisplay(ee.Array([-3]).add([-4])) # [-7]\n\ndisplay(ee.Array([5, 6]).add([7, 8])) # [12 ,14]\n\narray2x3 = ee.Array([[0, 1, 2], [3, 4, 5]])\ndisplay(array2x3.add(1)) # [[1, 2 ,3], [4, 5, 6]]\ndisplay(array2x3.add(array2x3)) # [[0, 2, 4], [6, 8, 10]]\n```"]]