ارسال بازخورد
ee.FeatureCollection.reduceToImage
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
با اعمال یک کاهنده بر روی خصوصیات انتخاب شده همه ویژگی هایی که هر پیکسل را قطع می کنند، یک تصویر از یک مجموعه ویژگی ایجاد می کند.
استفاده برمی گرداند FeatureCollection. reduceToImage (properties, reducer)
تصویر
استدلال تایپ کنید جزئیات این: collection
مجموعه ویژگی ها مجموعه ویژگی برای تقاطع با هر پیکسل خروجی. properties
فهرست کنید ویژگی هایی برای انتخاب از هر ویژگی و انتقال به کاهنده. reducer
کاهنده یک 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' ); راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap کولب (پایتون)
# 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
ارسال بازخورد
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
میخواهید موارد بیشتری را با ما درمیان بگذارید؟
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["`reduceToImage` creates an image from a FeatureCollection by applying a reducer to feature properties within each pixel."],["The reducer combines the properties of features intersecting a pixel into a single pixel value in the output image."],["You must specify the properties to include and the reducer to use when calling `reduceToImage`."],["Output image projection is determined by subsequent operations like `reproject` or `Export`."]]],[]]