Earth Engine 推出了
非商业配额层级 ,以保护共享计算资源并确保为所有人提供可靠的性能。非商业项目默认使用 Community
层级,但您可以随时更改项目的层级。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
发送反馈
ee.ImageCollection.select
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
从集合中的每张图片中选择波段。
返回具有所选波段的影像集合。
用法 返回 ImageCollection. select (selectors, names )ImageCollection
参数 类型 详细信息 此:imagecollection ImageCollection ImageCollection 实例。 selectorsList[Object] 一个名称、正则表达式或数字索引的列表,用于指定要选择的频段。 namesList[String],可选 输出频段的新名称列表。必须与所选频段的数量一致。
示例
代码编辑器 (JavaScript)
// A Sentinel-2 surface reflectance image collection.
var col = ee . ImageCollection ( 'COPERNICUS/S2_SR' )
. filterBounds ( ee . Geometry . Point ( - 122.152 , 37.336 ))
. filterDate ( '2021-01-01' , '2021-02-01' );
print ( 'All band names' , col . first (). bandNames ());
print ( 'Select a band by name' ,
col . select ( 'B11' ). first (). bandNames ());
print ( 'Select a band by index' ,
col . select ( 10 ). first (). bandNames ());
print ( 'Select bands using a list' ,
col . select ([ 'B11' , 'B8' , 'B3' ]). first (). bandNames ());
print ( 'Select bands by an argument series' ,
col . select ( 'B11' , 'B8' , 'B3' ). first (). bandNames ());
print ( 'Mixing string and integer selectors is valid' ,
col . select ( 10 , 'B8' , 2 ). first (). bandNames ());
print ( 'Rename selected bands using two corresponding lists' ,
col . select ([ 'B11' , 'B8' , 'B3' ], [ 'SWIR1' , 'NIR' , 'Green' ])
. first (). bandNames ());
// Use regular expressions to select bands.
print ( 'Match "QA" followed by any two characters' ,
col . select ( 'QA..' ). first (). bandNames ());
print ( 'Match "B" followed by any character, any number of times' ,
col . select ( 'B.*' ). first (). bandNames ());
print ( 'Match "B" followed by any character, and any optional third character' ,
col . select ( 'B..?' ). first (). bandNames ());
print ( 'Match "B" followed by a character in the range 6-8' ,
col . select ( 'B[6-8]' ). first (). bandNames ());
print ( 'Match "B" followed by a character in the range 1-9 and then 1-2' ,
col . select ( 'B[1-9][1-2]' ). first (). bandNames ());
print ( 'Match "B" or "QA" each followed by any character, any number of times.' ,
col . select ( 'B.*|QA.*' ). first (). bandNames ());
Python 设置
如需了解 Python API 和如何使用
geemap 进行交互式开发,请访问
Python 环境 页面。
import ee
import geemap.core as geemap
Colab (Python)
# A Sentinel-2 surface reflectance image collection.
col = ee . ImageCollection ( 'COPERNICUS/S2_SR' ) . filterBounds (
ee . Geometry . Point ( - 122.152 , 37.336 )
) . filterDate ( '2021-01-01' , '2021-02-01' )
display ( 'All band names' , col . first () . bandNames ())
display ( 'Select a band by name:' ,
col . select ( 'B11' ) . first () . bandNames ())
display ( 'Select a band by index:' ,
col . select ( 10 ) . first () . bandNames ())
display ( 'Select bands using a list:' ,
col . select ([ 'B11' , 'B8' , 'B3' ]) . first () . bandNames ())
display ( 'Select bands by an argument series:' ,
col . select ( 'B11' , 'B8' , 'B3' ) . first () . bandNames ())
display ( 'Mixing string and integer selectors is valid:' ,
col . select ( 10 , 'B8' , 2 ) . first () . bandNames ())
display ( 'Rename selected bands using two corresponding lists:' ,
col . select ([ 'B11' , 'B8' , 'B3' ], [ 'SWIR1' , 'NIR' , 'Green' ])
. first () . bandNames ())
# Use regular expressions to select bands.
display ( 'Match "QA" followed by any two characters:' ,
col . select ( 'QA..' ) . first () . bandNames ())
display ( 'Match "B" followed by any character, any number of times:' ,
col . select ( 'B.*' ) . first () . bandNames ())
display ( 'Match "B" followed by any character, and any optional third character:' ,
col . select ( 'B..?' ) . first () . bandNames ())
display ( 'Match "B" followed by a character in the range 6-8:' ,
col . select ( 'B[6-8]' ) . first () . bandNames ())
display ( 'Match "B" followed by a character in the range 1-9 and then 1-2:' ,
col . select ( 'B[1-9][1-2]' ) . first () . bandNames ())
display ( 'Match "B" or "QA" each followed by any character, any number of times:' ,
col . select ( 'B.*|QA.*' ) . first () . bandNames ())
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-01-08。
需要向我们提供更多信息?
[[["易于理解","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"]],["最后更新时间 (UTC):2026-01-08。"],[],["The `select` method extracts specific bands from an ImageCollection, returning a new ImageCollection with those bands. Band selection can be done by name, index, or a list of these. New band names can be assigned using an optional list, which must match the number of selected bands. Regular expressions can also be used to select bands based on pattern matching. The code examples demonstrate these selection techniques for both JavaScript and Python.\n"]]