ee.ImageCollection.toBands

यह फ़ंक्शन, किसी कलेक्शन को एक ही मल्टी-बैंड इमेज में बदलता है. इस इमेज में, कलेक्शन की हर इमेज के सभी बैंड शामिल होते हैं. आउटपुट बैंड के नाम, मौजूदा बैंड के नामों के आगे उस इमेज का आईडी जोड़कर बनाए जाते हैं जिससे वे बने हैं. उदाहरण के लिए, 'image1_band1'). ध्यान दें: ज़्यादा से ज़्यादा 5,000 बैंड बनाए जा सकते हैं.

इस्तेमालरिटर्न
ImageCollection.toBands()इमेज
आर्ग्यूमेंटटाइपविवरण
यह: collectionImageCollectionइनपुट कलेक्शन.

उदाहरण

कोड एडिटर (JavaScript)

// A Landsat 8 TOA image collection (2 months of images at a specific point).
var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
  .filterBounds(ee.Geometry.Point(-90.70, 34.71))
  .filterDate('2020-07-01', '2020-09-01')
  .select('B[4-5]');  // Get NIR and SWIR1 bands only.
print('Collection', col);

// Convert the image collection to a single multi-band image. Note that image ID
// ('system:index') is prepended to band names to delineate the source images.
var img = col.toBands();
print('Collection to bands', img);

// Band order is determined by collection order. Here, the collection is
// sorted in descending order of the date of observation (reverse of previous).
var bandOrder = col.sort('DATE_ACQUIRED', false).toBands();
print('Customized band order', bandOrder);

Python सेटअप करना

Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, Python एनवायरमेंट पेज देखें.

import ee
import geemap.core as geemap

Colab (Python)

# A Landsat 8 TOA image collection (2 months of images at a specific point).
col = (
    ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
    .filterBounds(ee.Geometry.Point(-90.70, 34.71))
    .filterDate('2020-07-01', '2020-09-01')
    .select('B[4-5]')
)  # Get NIR and SWIR1 bands only.
print('Collection:', col.getInfo())

# Convert the image collection to a single multi-band image. Note that image ID
# ('system:index') is prepended to band names to delineate the source images.
img = col.toBands()
print('Collection to bands:', img.getInfo())

# Band order is determined by collection order. Here, the collection is
# sorted in descending order of the date of observation (reverse of previous).
band_order = col.sort('DATE_ACQUIRED', False).toBands()
print('Customized band order:', band_order.getInfo())