ee.ImageCollection.reduceToImage

यह फ़ंक्शन, फ़ीचर कलेक्शन से इमेज बनाता है. इसके लिए, यह फ़ंक्शन उन सभी फ़ीचर की चुनी गई प्रॉपर्टी पर रिड्यूसर लागू करता है जो हर पिक्सल को इंटरसेक्ट करती हैं.

इस्तेमालरिटर्न
ImageCollection.reduceToImage(properties, reducer)इमेज
आर्ग्यूमेंटटाइपविवरण
यह: collectionFeatureCollectionहर आउटपुट पिक्सल के साथ इंटरसेक्ट करने के लिए, फ़ीचर कलेक्शन.
propertiesसूचीहर सुविधा से चुनने के लिए प्रॉपर्टी और उन्हें रिड्यूसर में पास करने के लिए प्रॉपर्टी.
reducerरेड्यूसरयह एक Reducer होता है. इसका इस्तेमाल, इंटरसेक्ट करने वाली हर सुविधा की प्रॉपर्टी को एक साथ मिलाकर, फ़ाइनल नतीजे में बदलने के लिए किया जाता है. इस फ़ाइनल नतीजे को पिक्सल में सेव किया जाता है.

उदाहरण

कोड एडिटर (JavaScript)

var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
  .filterBounds(ee.Geometry.BBox(-124.0, 43.2, -116.5, 46.3))
  .filterDate('2021', '2022');

// Image visualization settings.
var visParams = {
  bands: ['B4', 'B3', 'B2'],
  min: 0.01,
  max: 0.25
};
Map.addLayer(col.mean(), visParams, 'RGB mean');

// Reduce the geometry (footprint) of images in the collection to an image.
// Image property values are applied to the pixels intersecting each
// image's geometry and then a per-pixel reduction is performed according
// to the selected reducer. Here, the image cloud cover property is assigned
// to the pixels intersecting image geometry and then reduced to a single
// image representing the per-pixel mean image cloud cover.
var meanCloudCover = col.reduceToImage({
  properties: ['CLOUD_COVER'],
  reducer: ee.Reducer.mean()
});

Map.setCenter(-119.87, 44.76, 6);
Map.addLayer(meanCloudCover, {min: 0, max: 50}, 'Cloud cover mean');

Python सेटअप करना

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

import ee
import geemap.core as geemap

Colab (Python)

col = (
    ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
    .filterBounds(ee.Geometry.BBox(-124.0, 43.2, -116.5, 46.3))
    .filterDate('2021', '2022')
)

# Image visualization settings.
vis_params = {'bands': ['B4', 'B3', 'B2'], 'min': 0.01, 'max': 0.25}
m = geemap.Map()
m.add_layer(col.mean(), vis_params, 'RGB mean')

# Reduce the geometry (footprint) of images in the collection to an image.
# Image property values are applied to the pixels intersecting each
# image's geometry and then a per-pixel reduction is performed according
# to the selected reducer. Here, the image cloud cover property is assigned
# to the pixels intersecting image geometry and then reduced to a single
# image representing the per-pixel mean image cloud cover.
mean_cloud_cover = col.reduceToImage(
    properties=['CLOUD_COVER'], reducer=ee.Reducer.mean()
)

m.set_center(-119.87, 44.76, 6)
m.add_layer(mean_cloud_cover, {'min': 0, 'max': 50}, 'Cloud cover mean')
m