ee.Image.reduceRegion

একটি নির্দিষ্ট অঞ্চলের সমস্ত পিক্সেলে একটি রিডিউসার প্রয়োগ করুন।

হয় রিডিউসারটির ইনপুট সংখ্যা ইনপুট ইমেজের ব্যান্ডের সংখ্যার সমান হতে হবে, অথবা এটির একটিমাত্র ইনপুট থাকবে এবং প্রতিটি ব্যান্ডের জন্য সেটি পুনরাবৃত্ত হবে।

রিডিউসারের আউটপুটগুলোর একটি ডিকশনারি ফেরত দেয়।

ব্যবহার ফেরত
Image. reduceRegion (reducer, geometry , scale , crs , crsTransform , bestEffort , maxPixels , tileScale ) অভিধান
যুক্তি প্রকার বিস্তারিত
এই: image ছবি ছবিটি ছোট করতে হবে।
reducer হ্রাসকারী হ্রাসকারীটি প্রয়োগ করতে হবে।
geometry জ্যামিতি, ডিফল্ট: নাল যে অঞ্চলের উপর ডেটা হ্রাস করতে হবে। ডিফল্টরূপে এটি ইমেজের প্রথম ব্যান্ডের ফুটপ্রিন্ট হয়ে থাকে।
scale ফ্লোট, ডিফল্ট: নাল কাজ করার জন্য প্রক্ষেপণের একটি নামমাত্র মাপকাঠি, যা মিটারে পরিমাপ করা হয়।
crs প্রক্ষেপণ, ডিফল্ট: নাল যে প্রজেকশনে কাজ করা হবে। যদি নির্দিষ্ট না করা থাকে, তাহলে ছবির প্রথম ব্যান্ডের প্রজেকশন ব্যবহার করা হয়। যদি স্কেলের পাশাপাশি এটিও নির্দিষ্ট করা থাকে, তাহলে নির্দিষ্ট স্কেলে রিস্কেল করা হয়।
crsTransform তালিকা, ডিফল্ট: নাল CRS ট্রান্সফর্ম মানগুলির তালিকা। এটি ৩x২ ট্রান্সফর্ম ম্যাট্রিক্সের একটি রো-মেজর অর্ডারিং। এই অপশনটি 'স্কেল'-এর সাথে পারস্পরিকভাবে বর্জনীয়, এবং প্রোজেকশনে আগে থেকে সেট করা যেকোনো ট্রান্সফর্মকে প্রতিস্থাপন করে।
bestEffort বুলিয়ান, ডিফল্ট: ফলস যদি প্রদত্ত স্কেলে বহুভুজটিতে খুব বেশি পিক্সেল থাকে, তাহলে এমন একটি বৃহত্তর স্কেল গণনা করে ব্যবহার করুন যা অপারেশনটিকে সফল হতে দেবে।
maxPixels দীর্ঘ, ডিফল্ট: 10000000 হ্রাস করার জন্য পিক্সেলের সর্বোচ্চ সংখ্যা।
tileScale ফ্লোট, ডিফল্ট: ১ অ্যাগ্রিগেশন টাইলের আকার সামঞ্জস্য করার জন্য ০.১ থেকে ১৬-এর মধ্যে একটি স্কেলিং ফ্যাক্টর ব্যবহৃত হয়; এর চেয়ে বড় টাইলসকেল (যেমন, ২ বা ৪) সেট করলে ছোট টাইল ব্যবহৃত হয় এবং এর ফলে এমন গণনা সম্ভব হতে পারে যা ডিফল্ট সেটিংসে মেমোরি শেষ হয়ে যাওয়ার সমস্যায় পড়ে।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// A Landsat 8 surface reflectance image with SWIR1, NIR, and green bands.
var img = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508')
              .select(['SR_B6', 'SR_B5', 'SR_B3']);

// Santa Cruz Mountains ecoregion geometry.
var geom = ee.FeatureCollection('EPA/Ecoregions/2013/L4')
               .filter('us_l4name == "Santa Cruz Mountains"').geometry();

// Display layers on the map.
Map.setCenter(-122.08, 37.22, 9);
Map.addLayer(img, {min: 10000, max: 20000}, 'Landsat image');
Map.addLayer(geom, {color: 'white'}, 'Santa Cruz Mountains ecoregion');

// Calculate median band values within Santa Cruz Mountains ecoregion. It is
// good practice to explicitly define "scale" (or "crsTransform") and "crs"
// parameters of the analysis to avoid unexpected results from undesired
// defaults when e.g. reducing a composite image.
var stats = img.reduceRegion({
  reducer: ee.Reducer.median(),
  geometry: geom,
  scale: 30,  // meters
  crs: 'EPSG:3310',  // California Albers projection
});

// A dictionary is returned; keys are band names, values are the statistic.
print('Median band values, Santa Cruz Mountains ecoregion', stats);

// You can combine reducers to calculate e.g. mean and standard deviation
// simultaneously. The output dictionary keys are the concatenation of the band
// names and statistic names, separated by an underscore.
var reducer = ee.Reducer.mean().combine({
  reducer2: ee.Reducer.stdDev(),
  sharedInputs: true
});
var multiStats = img.reduceRegion({
  reducer: reducer,
  geometry: geom,
  scale: 30,
  crs: 'EPSG:3310',
});
print('Mean & SD band values, Santa Cruz Mountains ecoregion', multiStats);

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহারের তথ্যের জন্য পাইথন এনভায়রনমেন্ট পেজটি দেখুন।

import ee
import geemap.core as geemap

কোলাব (পাইথন)

# A Landsat 8 surface reflectance image with SWIR1, NIR, and green bands.
img = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508').select(
    ['SR_B6', 'SR_B5', 'SR_B3']
)

# Santa Cruz Mountains ecoregion geometry.
geom = (
    ee.FeatureCollection('EPA/Ecoregions/2013/L4')
    .filter('us_l4name == "Santa Cruz Mountains"')
    .geometry()
)

# Display layers on the map.
m = geemap.Map()
m.set_center(-122.08, 37.22, 9)
m.add_layer(img, {'min': 10000, 'max': 20000}, 'Landsat image')
m.add_layer(geom, {'color': 'white'}, 'Santa Cruz Mountains ecoregion')
display(m)

# Calculate median band values within Santa Cruz Mountains ecoregion. It is
# good practice to explicitly define "scale" (or "crsTransform") and "crs"
# parameters of the analysis to avoid unexpected results from undesired
# defaults when e.g. reducing a composite image.
stats = img.reduceRegion(
    reducer=ee.Reducer.median(),
    geometry=geom,
    scale=30,  # meters
    crs='EPSG:3310',  # California Albers projection
)

# A dictionary is returned keys are band names, values are the statistic.
display('Median band values, Santa Cruz Mountains ecoregion', stats)

# You can combine reducers to calculate e.g. mean and standard deviation
# simultaneously. The output dictionary keys are the concatenation of the band
# names and statistic names, separated by an underscore.
reducer = ee.Reducer.mean().combine(
    reducer2=ee.Reducer.stdDev(), sharedInputs=True
)
multi_stats = img.reduceRegion(
    reducer=reducer,
    geometry=geom,
    scale=30,
    crs='EPSG:3310',
)
display('Mean & SD band values, Santa Cruz Mountains ecoregion', multi_stats)