إشعار: يجب
إثبات الأهلية للاستخدام غير التجاري لجميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إليها. إذا لم يتم تأكيد حسابك بحلول 26 سبتمبر 2025، قد يتم تعليق إمكانية الوصول إليه.
ee.Image.addBands
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض هذه الدالة صورة تحتوي على جميع النطاقات التي تم نسخها من الإدخال الأول والنطاقات المحدّدة من الإدخال الثاني، مع إمكانية استبدال النطاقات في الصورة الأولى التي تحمل الاسم نفسه. تحتوي الصورة الجديدة على البيانات الوصفية والبصمة من صورة الإدخال الأولى.
| الاستخدام | المرتجعات |
|---|
Image.addBands(srcImg, names, overwrite) | صورة |
| الوسيطة | النوع | التفاصيل |
|---|
هذا: dstImg | صورة | صورة يتم نسخ النطاقات إليها |
srcImg | صورة | صورة تحتوي على نطاقات لنسخها |
names | قائمة، القيمة التلقائية: فارغة | قائمة اختيارية بأسماء الفرق الموسيقية التي تريد نسخها. في حال حذف الأسماء، سيتم نسخ جميع النطاقات من 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 للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap للتطوير التفاعلي.
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 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],["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"]]