お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、アクセスを維持するために
非商用目的での利用資格を確認する必要があります。2025 年 9 月 26 日までに確認が完了していない場合、アクセスが保留されることがあります。
ee.Image.addBands
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
最初の入力からコピーされたすべてのバンドと、2 番目の入力から選択されたバンドを含むイメージを返します。必要に応じて、最初のイメージの同じ名前のバンドを上書きします。新しい画像には、最初の入力画像のメタデータとフットプリントが含まれます。
| 用途 | 戻り値 |
|---|
Image.addBands(srcImg, names, overwrite) | 画像 |
| 引数 | タイプ | 詳細 |
|---|
これ: dstImg | 画像 | バンドのコピー先となる画像。 |
srcImg | 画像 | コピーするバンドを含む画像。 |
names | リスト、デフォルト: null | コピーする帯域名のリスト(省略可)。names が省略された場合、srcImg のすべてのバンドがコピーされます。 |
overwrite | ブール値。デフォルト値は false です。 | true の場合、`srcImg` のバンドは `dstImg` の同じ名前のバンドをオーバーライドします。それ以外の場合、新しいバンドは数値の接尾辞で名前が変更されます(`foo` から `foo_1`。ただし、`foo_1` が存在する場合は `foo_2` など)。 |
例
コードエディタ(JavaScript)
// A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
print('Original image', img);
// Scale reflectance bands and overwrite the original bands.
var reflBands = img.select('B.*').divide(10000);
img = img.addBands({
srcImg: reflBands,
overwrite: true
});
// Compute and add a single band (NDVI).
var ndvi = img.normalizedDifference(['B8', 'B4']).rename('NDVI');
img = img.addBands(ndvi);
// Compute and add multiple bands (NDWI and NBR).
var ndwi = img.normalizedDifference(['B3', 'B8']).rename('NDWI');
var nbr = img.normalizedDifference(['B8', 'B12']).rename('NBR');
var newBands = ee.Image([ndwi, nbr]);
img = img.addBands(newBands);
print('Image with added/modified bands', img);
Python の設定
Python API とインタラクティブな開発での geemap の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# A Sentinel-2 surface reflectance image.
img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
print('Original image:', img.getInfo())
# Scale reflectance bands and overwrite the original bands.
refl_bands = img.select('B.*').divide(10000)
img = img.addBands(srcImg=refl_bands, overwrite=True)
# Compute and add a single band (NDVI).
ndvi = img.normalizedDifference(['B8', 'B4']).rename('NDVI')
img = img.addBands(ndvi)
# Compute and add multiple bands (NDWI and NBR).
ndwi = img.normalizedDifference(['B3', 'B8']).rename('NDWI')
nbr = img.normalizedDifference(['B8', 'B12']).rename('NBR')
new_bands = ee.Image([ndwi, nbr])
img = img.addBands(new_bands)
print('Image with added/modified bands:', img.getInfo())
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],["The `addBands` function combines bands from two images. It copies all bands from the first image and specified or all bands from the second. The user can select specific bands from the second image to add. If band names overlap, the `overwrite` parameter determines if bands from the second image replace those in the first; otherwise, they're renamed with a numerical suffix. The resulting image retains the first image's metadata and footprint.\n"]]