ee.ImageCollection.getRegion

किसी ImageCollection में मौजूद हर [pixel, band, image] टपल के लिए, वैल्यू का ऐरे आउटपुट करता है. आउटपुट में, आईडी, लोंगिट्यूड, लैटीट्यूड, समय, और हर उस इमेज के लिए सभी बैंड की पंक्तियां शामिल होती हैं जो दिए गए इलाके में मौजूद हर पिक्सल से इंटरसेक्ट करती हैं. 10,48,576 से ज़्यादा वैल्यू एक्सट्रैक्ट करने की कोशिश करने पर गड़बड़ी होगी.

इस्तेमालरिटर्न
ImageCollection.getRegion(geometry, scale, crs, crsTransform)सूची
आर्ग्यूमेंटटाइपविवरण
यह: collectionImageCollectionवह इमेज कलेक्शन जिससे डेटा एक्सट्रैक्ट करना है.
geometryज्यामितिवह क्षेत्र जिससे डेटा एक्सट्रैक्ट करना है.
scaleफ़्लोट, डिफ़ॉल्ट: nullयह प्रोजेक्शन का नॉमिनल स्केल है, जिसमें काम करना है. यह मीटर में होता है.
crsअनुमान, ज़रूरी नहीं हैकाम करने के लिए प्रोजेक्शन. अगर यह जानकारी नहीं दी जाती है, तो डिफ़ॉल्ट रूप से EPSG:4326 का इस्तेमाल किया जाता है. अगर स्केल के साथ-साथ प्रोजेक्शन भी तय किया गया है, तो प्रोजेक्शन को तय किए गए स्केल के हिसाब से फिर से स्केल किया जाता है.
crsTransformसूची, डिफ़ॉल्ट: nullसीआरएस ट्रांसफ़ॉर्म वैल्यू का कलेक्शन. यह 3x2 ऐफ़ाइन ट्रांसफ़ॉर्म का लाइन-मेजर ऑर्डर है. यह विकल्प, स्केल विकल्प के साथ काम नहीं करता. साथ ही, यह दिए गए प्रोजेक्शन पर पहले से सेट किए गए किसी भी ट्रांसफ़ॉर्म की जगह ले लेगा.

उदाहरण

कोड एडिटर (JavaScript)

// A Landsat 8 TOA image collection (3 months at a specific point, RGB bands).
var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
  .filterBounds(ee.Geometry.Point(-90.70, 34.71))
  .filterDate('2020-07-01', '2020-10-01')
  .select('B[2-4]');
print('Collection', col);

// Define a region to get pixel values for. This is a small rectangle region
// that intersects 2 image pixels at 30-meter scale.
var roi = ee.Geometry.BBox(-90.496353, 34.851971, -90.495749, 34.852197);

// Display the region of interest overlaid on an image representative. Note
// the ROI intersection with 2 pixels.
var visParams = {
  bands: ['B4', 'B3', 'B2'],
  min: 0.128,
  max: 0.163
};
Map.setCenter(-90.49605, 34.85211, 19);
Map.addLayer(col.first(), visParams, 'Image representative');
Map.addLayer(roi, {color: 'white'}, 'ROI');

// Fetch pixel-level information from all images in the collection for the
// pixels intersecting the ROI.
var pixelInfoBbox = col.getRegion({
  geometry: roi,
  scale: 30
});

// The result is a table (a list of lists) where the first row is column
// labels and subsequent rows are image pixels. Columns contain values for
// the image ID ('system:index'), pixel longitude and latitude, image
// observation time ('system:time_start'), and bands. In this example, note
// that there are 5 images and the region intersects 2 pixels, so n rows
// equals 11 (5 * 2 + 1). All collection images must have the same number of
// bands with the same names.
print('Extracted pixel info', pixelInfoBbox);

// The function accepts all geometry types (e.g., points, lines, polygons).
// Here, a multi-point geometry with two points is used.
var points = ee.Geometry.MultiPoint([[-90.49, 34.85], [-90.48, 34.84]]);
var pixelInfoPoints = col.getRegion({
  geometry: points,
  scale: 30
});
print('Point geometry example', pixelInfoPoints);

Python सेटअप करना

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

import ee
import geemap.core as geemap

Colab (Python)

# A Landsat 8 TOA image collection (3 months at a specific point, RGB bands).
col = (
    ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
    .filterBounds(ee.Geometry.Point(-90.70, 34.71))
    .filterDate('2020-07-01', '2020-10-01')
    .select('B[2-4]')
)
display('Collection', col)

# Define a region to get pixel values for. This is a small rectangle region
# that intersects 2 image pixels at 30-meter scale.
roi = ee.Geometry.BBox(-90.496353, 34.851971, -90.495749, 34.852197)

# Display the region of interest overlaid on an image representative. Note
# the ROI intersection with 2 pixels.
vis_params = {'bands': ['B4', 'B3', 'B2'], 'min': 0.128, 'max': 0.163}
m = geemap.Map()
m.set_center(-90.49605, 34.85211, 19)
m.add_layer(col.first(), vis_params, 'Image representative')
m.add_layer(roi, {'color': 'white'}, 'ROI')
display(m)

# Fetch pixel-level information from all images in the collection for the
# pixels intersecting the ROI.
pixel_info_bbox = col.getRegion(geometry=roi, scale=30)

# The result is a table (a list of lists) where the first row is column
# labels and subsequent rows are image pixels. Columns contain values for
# the image ID ('system:index'), pixel longitude and latitude, image
# observation time ('system:time_start'), and bands. In this example, note
# that there are 5 images and the region intersects 2 pixels, so n rows
# equals 11 (5 * 2 + 1). All collection images must have the same number of
# bands with the same names.
display('Extracted pixel info', pixel_info_bbox)

# The function accepts all geometry types (e.g., points, lines, polygons).
# Here, a multi-point geometry with two points is used.
points = ee.Geometry.MultiPoint([[-90.49, 34.85], [-90.48, 34.84]])
pixel_info_points = col.getRegion(geometry=points, scale=30)
display('Point geometry example', pixel_info_points)