ee.FeatureCollection.reduceToImage

প্রতিটি পিক্সেলকে ছেদ করে এমন সমস্ত বৈশিষ্ট্যের নির্বাচিত বৈশিষ্ট্যগুলির উপর একটি রিডুসার প্রয়োগ করে একটি বৈশিষ্ট্য সংগ্রহ থেকে একটি চিত্র তৈরি করে৷

ব্যবহার রিটার্নস
FeatureCollection. reduceToImage (properties, reducer) ছবি
যুক্তি টাইপ বিস্তারিত
এই: collection ফিচার কালেকশন প্রতিটি আউটপুট পিক্সেলের সাথে ছেদ করার জন্য বৈশিষ্ট্য সংগ্রহ।
properties তালিকা বৈশিষ্ট্যগুলি প্রতিটি বৈশিষ্ট্য থেকে নির্বাচন করুন এবং রিডুসারে পাস করুন৷
reducer হ্রাসকারী পিক্সেলে সঞ্চয় করার জন্য একটি চূড়ান্ত ফলাফলে প্রতিটি ছেদকারী বৈশিষ্ট্যের বৈশিষ্ট্যগুলিকে একত্রিত করার জন্য একটি হ্রাসকারী।

উদাহরণ

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

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

// Create an image from features; pixel values are determined from reduction of
// property values of the features intersecting each pixel.
var image = fc.reduceToImage({
  properties: ['gwh_estimt'],
  reducer: ee.Reducer.sum()
});

// The goal is to sum the electricity generated in 2015 for the power plants
// intersecting 10 km cells and view the result as a map layer.
// ee.FeatureCollection.reduceToImage does not allow the image projection to be
// set because it is waiting on downstream functions that include "crs",
// "scale", and "crsTransform" parameters to define it (e.g., Export.image.*).
// Here, we'll force the projection with ee.Image.reproject so the result can be
// viewed in the map. Note that using small scales with reproject while viewing
// large regions breaks the features that make Earth Engine fast and may result
// in poor performance and/or errors.
image = image.reproject('EPSG:3035', null, 10000);

// Display the image on the map.
Map.setCenter(4.3376, 50.947, 8);
Map.setLocked(true);
Map.addLayer(
    image.updateMask(image.gt(0)),
    {min: 0, max: 2000, palette: ['yellow', 'orange', 'red']},
    'Total estimated annual electricity generation, 2015');
Map.addLayer(fc, null, 'Belgian power plants');

পাইথন সেটআপ

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

import ee
import geemap.core as geemap

Colab (পাইথন)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"'
)

# Create an image from features pixel values are determined from reduction of
# property values of the features intersecting each pixel.
image = fc.reduceToImage(properties=['gwh_estimt'], reducer=ee.Reducer.sum())

# The goal is to sum the electricity generated in 2015 for the power plants
# intersecting 10 km cells and view the result as a map layer.
# ee.FeatureCollection.reduceToImage does not allow the image projection to be
# set because it is waiting on downstream functions that include "crs",
# "scale", and "crsTransform" parameters to define it (e.g., Export.image.*).
# Here, we'll force the projection with ee.Image.reproject so the result can be
# viewed in the map. Note that using small scales with reproject while viewing
# large regions breaks the features that make Earth Engine fast and may result
# in poor performance and/or errors.
image = image.reproject('EPSG:3035', None, 10000)

# Display the image on the map.
m = geemap.Map()
m.set_center(4.3376, 50.947, 8)
m.add_layer(
    image.updateMask(image.gt(0)),
    {'min': 0, 'max': 2000, 'palette': ['yellow', 'orange', 'red']},
    'Total estimated annual electricity generation, 2015',
)
m.add_layer(fc, None, 'Belgian power plants')
m