सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए,
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
ee.Image.addBands
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ंक्शन, पहली इमेज से कॉपी किए गए सभी बैंड और दूसरी इमेज से चुने गए बैंड वाली इमेज दिखाता है. इसके अलावा, यह पहली इमेज में मौजूद एक ही नाम वाले बैंड को बदलने का विकल्प भी देता है. नई इमेज में, पहली इनपुट इमेज का मेटाडेटा और फ़ुटप्रिंट मौजूद होता है.
| इस्तेमाल | रिटर्न |
|---|
Image.addBands(srcImg, names, overwrite) | इमेज |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|
यह: dstImg | इमेज | वह इमेज जिसमें बैंड कॉपी करने हैं. |
srcImg | इमेज | कॉपी करने के लिए बैंड वाली इमेज. |
names | सूची, डिफ़ॉल्ट: null | कॉपी किए जाने वाले बैंड के नामों की सूची. यह सूची देना ज़रूरी नहीं है. अगर नामों को शामिल नहीं किया जाता है, तो srcImg की सभी बैंड कॉपी हो जाएंगी. |
overwrite | बूलियन, डिफ़ॉल्ट वैल्यू: false | अगर यह विकल्प सही है, तो `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())
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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"]]