公告:所有在 
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。如果您在 2025 年 9 月 26 日之前未完成验证,您的访问权限可能会被暂停。
  
        
 
       
     
  
  
  
    
  
  
  
    
      ee.ImageCollection.set
    
    
      
    
    
      
      使用集合让一切井井有条
    
    
      
      根据您的偏好保存内容并对其进行分类。
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
  
  
替换元素的 1 个或多个元数据属性。
返回具有指定属性覆盖的元素。
| 用法 | 返回 | 
|---|
| ImageCollection.set(var_args) | 元素 | 
| 参数 | 类型 | 详细信息 | 
|---|
| 此: element | 元素 | Element 实例。 | 
| var_args | VarArgs<Object> | 属性字典或属性的 vararg 序列,例如 key1、value1、key2、value2 等。 | 
  
  
  示例
  
    
  
  
    
    
  
  
  
  
    
    
    
      代码编辑器 (JavaScript)
    
    
  // A contrived, empty image collection for simple demonstration.
var col = ee.ImageCollection([]);
print('Collection without properties', col);
// Set collection properties using a dictionary.
col = col.set({
  project_name: 'biomass_tracking',
  project_id: 3,
  plot_ids: ee.Array([7, 11, 20])
});
// Set collection properties using a series of key-value pairs.
col = col.set('project_year', 2018,
              'rgb_vis', 'false_color');
print('Collection with properties', col);
// Get a dictionary of collection property keys and values.
print('Property keys and values (ee.Dictionary)', col.toDictionary());
// Get the value of a collection property. To use the result of
// ee.ImageCollection.get in further computation, you need to cast it to the
// appropriate class, for example, ee.Number(result) or ee.String(result).
print('Project ID (ambiguous object)', col.get('project_id'));
// Get the value of a string collection property as an ee.String object.
print('Project name (ee.String)', col.getString('project_name'));
// Get the value of a numeric collection property as an ee.Number object.
print('Project year (ee.Number)', col.getNumber('project_year'));
// Get the value of an ee.Array collection property as an ee.Array object.
print('Plot IDs (ee.Array)', col.getArray('plot_ids'));
  
    
  
  
    
  
  
  
  
    
  
    
  Python 设置
  如需了解 Python API 和如何使用 geemap 进行交互式开发,请参阅 
    Python 环境页面。
  import ee
import geemap.core as geemap
  
    
    
      Colab (Python)
    
    
  # A contrived, empty image collection for simple demonstration.
col = ee.ImageCollection([])
display('Collection without properties:', col)
# Set collection properties using a dictionary.
col = col.set({
    'project_name': 'biomass_tracking',
    'project_id': 3,
    'plot_ids': ee.Array([7, 11, 20])
})
# Set collection properties using a series of key-value pairs.
col = col.set('project_year', 2018,
              'rgb_vis', 'false_color')
display('Collection with properties:', col)
# Get a dictionary of collection property keys and values.
display('Property keys and values (ee.Dictionary):', col.toDictionary())
# Get the value of a collection property. To use the result of
# ee.ImageCollection.get in further computation, you need to cast it to the
# appropriate class, for example, ee.Number(result) or ee.String(result).
display('Project ID (ambiguous object):', col.get('project_id'))
# Get the value of a string collection property as an ee.String object.
display('Project name (ee.String):', col.getString('project_name'))
# Get the value of a numeric collection property as an ee.Number object.
display('Project year (ee.Number):', col.getNumber('project_year'))
# Get the value of an ee.Array collection property as an ee.Array object.
display('Plot IDs (ee.Array):', col.getArray('plot_ids'))
  
  
  
  
  
 
  
    
    
      
       
    
    
  
  
  如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
  最后更新时间 (UTC):2025-10-30。
  
  
  
    
      [null,null,["最后更新时间 (UTC):2025-10-30。"],[],[]]