公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.ImageCollection
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ImageCollection 可通过以下实参构建:
- 字符串:假定为集合的名称,
- 图片列表,或可用于构建图片的任何内容。
- 单张图片。
- 计算对象 - 重新解释为集合。
用法 | 返回 |
---|
ee.ImageCollection(args) | ImageCollection |
参数 | 类型 | 详细信息 |
---|
args | ComputedObject|Image|List<Object>|String | 构造函数实参。 |
示例
代码编辑器 (JavaScript)
print('Image collection from a string',
ee.ImageCollection('COPERNICUS/S2_SR').limit(3));
var img1 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNK');
var img2 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNL');
var img3 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNM');
print('Image collection from a list of images',
ee.ImageCollection([img1, img2, img3]));
print('Image collection from a single image',
ee.ImageCollection(img1));
Python 设置
如需了解 Python API 和如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
import ee
import geemap.core as geemap
Colab (Python)
print('Image collection from a string:',
ee.ImageCollection('COPERNICUS/S2_SR').limit(3).getInfo())
img1 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNK')
img2 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNL')
img3 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNM')
print('Image collection from a list of images:',
ee.ImageCollection([img1, img2, img3]).getInfo())
print('Image collection from a single image:',
ee.ImageCollection(img1).getInfo())
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003e\u003ccode\u003eee.ImageCollection\u003c/code\u003e can be constructed from a variety of inputs, including a string representing a collection name, a list of images, or a single image.\u003c/p\u003e\n"],["\u003cp\u003eUsing a string as input, such as a collection name like 'COPERNICUS/S2_SR', allows you to create an ImageCollection directly from that dataset.\u003c/p\u003e\n"],["\u003cp\u003eWhen providing a list of images or a single image, the \u003ccode\u003eee.ImageCollection\u003c/code\u003e constructor creates a collection containing those specified elements.\u003c/p\u003e\n"],["\u003cp\u003eComputed objects are also valid inputs, and they are reinterpreted as a collection when used to create an \u003ccode\u003eee.ImageCollection\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection\n\n\u003cbr /\u003e\n\nImageCollections can be constructed from the following arguments:\n\n\u003cbr /\u003e\n\n- A string: assumed to be the name of a collection,\n\n- A list of images, or anything that can be used to construct an image.\n\n- A single image.\n\n- A computed object - reinterpreted as a collection.\n\n| Usage | Returns |\n|----------------------------|-----------------|\n| `ee.ImageCollection(args)` | ImageCollection |\n\n| Argument | Type | Details |\n|----------|-----------------------------------------------|----------------------------|\n| `args` | ComputedObject\\|Image\\|List\\\u003cObject\\\u003e\\|String | The constructor arguments. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint('Image collection from a string',\n ee.ImageCollection('COPERNICUS/S2_SR').limit(3));\n\nvar img1 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNK');\nvar img2 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNL');\nvar img3 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNM');\nprint('Image collection from a list of images',\n ee.ImageCollection([img1, img2, img3]));\n\nprint('Image collection from a single image',\n ee.ImageCollection(img1));\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nprint('Image collection from a string:',\n ee.ImageCollection('COPERNICUS/S2_SR').limit(3).getInfo())\n\nimg1 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNK')\nimg2 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNL')\nimg3 = ee.Image('COPERNICUS/S2_SR/20170328T083601_20170328T084228_T35RNM')\nprint('Image collection from a list of images:',\n ee.ImageCollection([img1, img2, img3]).getInfo())\n\nprint('Image collection from a single image:',\n ee.ImageCollection(img1).getInfo())\n```"]]