ارسال بازخورد
ee.ImageCollection.fromImages
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مجموعه تصاویر حاوی تصاویر داده شده را برمی گرداند.
استفاده برمی گرداند ee.ImageCollection.fromImages(images)
ImageCollection
استدلال تایپ کنید جزئیات images
فهرست کنید تصاویری که باید در مجموعه گنجانده شود.
نمونه ها ویرایشگر کد (جاوا اسکریپت)
// A series of images.
var img1 = ee . Image ( 0 );
var img2 = ee . Image ( 1 );
var img3 = ee . Image ( 2 );
// Convert the list of images into an image collection.
var col = ee . ImageCollection . fromImages ([ img1 , img2 , img3 ]);
print ( 'Collection from list of images' , col );
// The ee.ImageCollection.fromImages function is intended to coerce the image
// list to a collection when the list is an ambiguous, computed object fetched
// from the properties of a server-side object. For instance, a list
// of images retrieved from a ee.Feature property. Here, we set an image
// list as a property of a feature, retrieve it, and convert it to
// a collection. Notice that the ee.ImageCollection constructor fails to coerce
// the image list to a collection, but ee.ImageCollection.fromImages does.
var feature = ee . Feature ( null ). set ( 'img_list' , [ img1 , img2 , img3 ]);
var ambiguousImgList = feature . get ( 'img_list' );
print ( 'Coerced to collection' , ee . ImageCollection . fromImages ( ambiguousImgList ));
print ( 'NOT coerced to collection' , ee . ImageCollection ( ambiguousImgList ));
// A common use case is coercing an image list from a saveAll join to a
// image collection, like in this example of building a collection of mean
// annual NDVI images from a MODIS collection.
var modisCol = ee . ImageCollection ( 'MODIS/006/MOD13A2' )
. filterDate ( '2017' , '2021' )
. select ( 'NDVI' )
. map ( function ( img ) { return img . set ( 'year' , img . date (). get ( 'year' ))});
var distinctYearCol = modisCol . distinct ( 'year' );
var joinedCol = ee . Join . saveAll ( 'img_list' ). apply ({
primary : distinctYearCol ,
secondary : modisCol ,
condition : ee . Filter . equals ({ 'leftField' : 'year' , 'rightField' : 'year' })
});
var annualNdviMean = joinedCol . map ( function ( img ) {
return ee . ImageCollection . fromImages ( img . get ( 'img_list' )). mean ()
. copyProperties ( img , [ 'year' ]);
});
print ( 'Mean annual NDVI collection' , annualNdviMean ); راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap کولب (پایتون)
# A series of images.
img1 = ee . Image ( 0 )
img2 = ee . Image ( 1 )
img3 = ee . Image ( 2 )
# Convert the list of images into an image collection.
col = ee . ImageCollection . fromImages ([ img1 , img2 , img3 ])
print ( 'Collection from list of images:' , col . getInfo ())
# The ee.ImageCollection.fromImages function is intended to coerce the image
# list to a collection when the list is an ambiguous, computed object fetched
# from the properties of a server-side object. For instance, a list
# of images retrieved from a ee.Feature property. Here, we set an image
# list as a property of a feature, retrieve it, and convert it to
# a collection. Notice that the ee.ImageCollection constructor fails to coerce
# the image list to a collection, but ee.ImageCollection.fromImages does.
feature = ee . Feature ( None ) . set ( 'img_list' , [ img1 , img2 , img3 ])
ambiguous_img_list = feature . get ( 'img_list' )
print (
'Coerced to collection:' ,
ee . ImageCollection . fromImages ( ambiguous_img_list ) . getInfo (),
)
print (
'NOT coerced to collection:' ,
ee . ImageCollection ( ambiguous_img_list ) . getInfo (),
)
# A common use case is coercing an image list from a saveAll join to a
# image collection, like in this example of building a collection of mean
# annual NDVI images from a MODIS collection.
modis_col = (
ee . ImageCollection ( 'MODIS/006/MOD13A2' )
. filterDate ( '2017' , '2021' )
. select ( 'NDVI' )
. map ( lambda img : img . set ( 'year' , img . date () . get ( 'year' )))
)
distinct_year_col = modis_col . distinct ( 'year' )
joined_col = ee . Join . saveAll ( 'img_list' ) . apply (
primary = distinct_year_col ,
secondary = modis_col ,
condition = ee . Filter . equals ( leftField = 'year' , rightField = 'year' ),
)
annual_ndvi_mean = joined_col . map (
lambda img : ee . ImageCollection . fromImages ( img . get ( 'img_list' ))
. mean ()
. copyProperties ( img , [ 'year' ])
)
print ( 'Mean annual NDVI collection:' , annual_ndvi_mean . getInfo ()) ،مجموعه تصاویر حاوی تصاویر داده شده را برمی گرداند.
استفاده برمی گرداند ee.ImageCollection.fromImages(images)
ImageCollection
استدلال تایپ کنید جزئیات images
فهرست کنید تصاویری که باید در مجموعه گنجانده شود.
نمونه ها ویرایشگر کد (جاوا اسکریپت)
// A series of images.
var img1 = ee . Image ( 0 );
var img2 = ee . Image ( 1 );
var img3 = ee . Image ( 2 );
// Convert the list of images into an image collection.
var col = ee . ImageCollection . fromImages ([ img1 , img2 , img3 ]);
print ( 'Collection from list of images' , col );
// The ee.ImageCollection.fromImages function is intended to coerce the image
// list to a collection when the list is an ambiguous, computed object fetched
// from the properties of a server-side object. For instance, a list
// of images retrieved from a ee.Feature property. Here, we set an image
// list as a property of a feature, retrieve it, and convert it to
// a collection. Notice that the ee.ImageCollection constructor fails to coerce
// the image list to a collection, but ee.ImageCollection.fromImages does.
var feature = ee . Feature ( null ). set ( 'img_list' , [ img1 , img2 , img3 ]);
var ambiguousImgList = feature . get ( 'img_list' );
print ( 'Coerced to collection' , ee . ImageCollection . fromImages ( ambiguousImgList ));
print ( 'NOT coerced to collection' , ee . ImageCollection ( ambiguousImgList ));
// A common use case is coercing an image list from a saveAll join to a
// image collection, like in this example of building a collection of mean
// annual NDVI images from a MODIS collection.
var modisCol = ee . ImageCollection ( 'MODIS/006/MOD13A2' )
. filterDate ( '2017' , '2021' )
. select ( 'NDVI' )
. map ( function ( img ) { return img . set ( 'year' , img . date (). get ( 'year' ))});
var distinctYearCol = modisCol . distinct ( 'year' );
var joinedCol = ee . Join . saveAll ( 'img_list' ). apply ({
primary : distinctYearCol ,
secondary : modisCol ,
condition : ee . Filter . equals ({ 'leftField' : 'year' , 'rightField' : 'year' })
});
var annualNdviMean = joinedCol . map ( function ( img ) {
return ee . ImageCollection . fromImages ( img . get ( 'img_list' )). mean ()
. copyProperties ( img , [ 'year' ]);
});
print ( 'Mean annual NDVI collection' , annualNdviMean ); راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap کولب (پایتون)
# A series of images.
img1 = ee . Image ( 0 )
img2 = ee . Image ( 1 )
img3 = ee . Image ( 2 )
# Convert the list of images into an image collection.
col = ee . ImageCollection . fromImages ([ img1 , img2 , img3 ])
print ( 'Collection from list of images:' , col . getInfo ())
# The ee.ImageCollection.fromImages function is intended to coerce the image
# list to a collection when the list is an ambiguous, computed object fetched
# from the properties of a server-side object. For instance, a list
# of images retrieved from a ee.Feature property. Here, we set an image
# list as a property of a feature, retrieve it, and convert it to
# a collection. Notice that the ee.ImageCollection constructor fails to coerce
# the image list to a collection, but ee.ImageCollection.fromImages does.
feature = ee . Feature ( None ) . set ( 'img_list' , [ img1 , img2 , img3 ])
ambiguous_img_list = feature . get ( 'img_list' )
print (
'Coerced to collection:' ,
ee . ImageCollection . fromImages ( ambiguous_img_list ) . getInfo (),
)
print (
'NOT coerced to collection:' ,
ee . ImageCollection ( ambiguous_img_list ) . getInfo (),
)
# A common use case is coercing an image list from a saveAll join to a
# image collection, like in this example of building a collection of mean
# annual NDVI images from a MODIS collection.
modis_col = (
ee . ImageCollection ( 'MODIS/006/MOD13A2' )
. filterDate ( '2017' , '2021' )
. select ( 'NDVI' )
. map ( lambda img : img . set ( 'year' , img . date () . get ( 'year' )))
)
distinct_year_col = modis_col . distinct ( 'year' )
joined_col = ee . Join . saveAll ( 'img_list' ) . apply (
primary = distinct_year_col ,
secondary = modis_col ,
condition = ee . Filter . equals ( leftField = 'year' , rightField = 'year' ),
)
annual_ndvi_mean = joined_col . map (
lambda img : ee . ImageCollection . fromImages ( img . get ( 'img_list' ))
. mean ()
. copyProperties ( img , [ 'year' ])
)
print ( 'Mean annual NDVI collection:' , annual_ndvi_mean . getInfo ())
ارسال بازخورد
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز 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 بهوقت ساعت هماهنگ جهانی."],[],["`ee.ImageCollection.fromImages(images)` converts a list of images into an ImageCollection. This function is crucial for handling ambiguous, computed image lists, like those retrieved from server-side object properties. It successfully coerces image lists into collections, unlike the standard `ee.ImageCollection` constructor. A common use case is processing lists generated by `ee.Join.saveAll`, demonstrated by building a collection of mean annual NDVI images from MODIS data, efficiently grouping images and calculating yearly averages.\n"]]