Tổng quan về ImageCollection
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
ImageCollection
là một ngăn xếp hoặc trình tự hình ảnh.
Tạo từ mã bộ sưu tập
Bạn có thể tải ImageCollection
bằng cách dán mã thành phần Earth Engine vào hàm khởi tạo ImageCollection
. Bạn có thể tìm thấy mã nhận dạng ImageCollection
trong danh mục dữ liệu. Ví dụ: để tải bộ sưu tập độ phản chiếu bề mặt của Sentinel-2:
Trình soạn thảo mã (JavaScript)
var sentinelCollection = ee.ImageCollection('COPERNICUS/S2_SR');
Thiết lập Python
Hãy xem trang
Môi trường Python để biết thông tin về API Python và cách sử dụng geemap
cho hoạt động phát triển tương tác.
import ee
import geemap.core as geemap
Colab (Python)
sentinel_collection = ee.ImageCollection('COPERNICUS/S2_SR')
Bộ sưu tập này chứa mọi hình ảnh Sentinel-2 trong danh mục công khai.
Có rất nhiều. Thông thường, bạn sẽ muốn lọc bộ sưu tập như tại đây hoặc tại đây.
Tạo từ danh sách hình ảnh
Hàm khởi tạo ee.ImageCollection()
hoặc phương thức tiện lợi ee.ImageCollection.fromImages()
tạo bộ sưu tập hình ảnh từ danh sách hình ảnh. Bạn cũng có thể tạo bộ sưu tập hình ảnh mới bằng cách hợp nhất các bộ sưu tập hiện có. Ví dụ:
Trình soạn thảo mã (JavaScript)
// Create arbitrary constant images.
var constant1 = ee.Image(1);
var constant2 = ee.Image(2);
// Create a collection by giving a list to the constructor.
var collectionFromConstructor = ee.ImageCollection([constant1, constant2]);
print('collectionFromConstructor: ', collectionFromConstructor);
// Create a collection with fromImages().
var collectionFromImages = ee.ImageCollection.fromImages(
[ee.Image(3), ee.Image(4)]);
print('collectionFromImages: ', collectionFromImages);
// Merge two collections.
var mergedCollection = collectionFromConstructor.merge(collectionFromImages);
print('mergedCollection: ', mergedCollection);
// Create a toy FeatureCollection
var features = ee.FeatureCollection(
[ee.Feature(null, {foo: 1}), ee.Feature(null, {foo: 2})]);
// Create an ImageCollection from the FeatureCollection
// by mapping a function over the FeatureCollection.
var images = features.map(function(feature) {
return ee.Image(ee.Number(feature.get('foo')));
});
// Print the resultant collection.
print('Image collection: ', images);
Thiết lập Python
Hãy xem trang
Môi trường Python để biết thông tin về API Python và cách sử dụng geemap
cho hoạt động phát triển tương tác.
import ee
import geemap.core as geemap
Colab (Python)
# Create arbitrary constant images.
constant_1 = ee.Image(1)
constant_2 = ee.Image(2)
# Create a collection by giving a list to the constructor.
collection_from_constructor = ee.ImageCollection([constant_1, constant_2])
display('Collection from constructor:', collection_from_constructor)
# Create a collection with fromImages().
collection_from_images = ee.ImageCollection.fromImages(
[ee.Image(3), ee.Image(4)]
)
display('Collection from images:', collection_from_images)
# Merge two collections.
merged_collection = collection_from_constructor.merge(collection_from_images)
display('Merged collection:', merged_collection)
# Create a toy FeatureCollection
features = ee.FeatureCollection(
[ee.Feature(None, {'foo': 1}), ee.Feature(None, {'foo': 2})]
)
# Create an ImageCollection from the FeatureCollection
# by mapping a function over the FeatureCollection.
images = features.map(lambda feature: ee.Image(ee.Number(feature.get('foo'))))
# Display the resultant collection.
display('Image collection:', images)
Xin lưu ý rằng trong ví dụ này, ImageCollection
được tạo bằng cách ánh xạ một hàm trả về Image
trên FeatureCollection
. Tìm hiểu thêm về cách liên kết trong phần Liên kết trên một phần ImageCollection. Tìm hiểu thêm về tập hợp tính năng trong mục FeatureCollection.
Tạo từ danh sách COG
Tạo ImageCollection
từ GeoTiff trong Cloud Storage.
Ví dụ:
Trình soạn thảo mã (JavaScript)
// All the GeoTiffs are in this folder.
var uriBase = 'gs://gcp-public-data-landsat/LC08/01/001/002/' +
'LC08_L1GT_001002_20160817_20170322_01_T2/';
// List of URIs, one for each band.
var uris = ee.List([
uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B2.TIF',
uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B3.TIF',
uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B4.TIF',
uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF',
]);
// Make a collection from the list of images.
var images = uris.map(ee.Image.loadGeoTIFF);
var collection = ee.ImageCollection(images);
// Get an RGB image from the collection of bands.
var rgb = collection.toBands().rename(['B2', 'B3', 'B4', 'B5']);
Map.centerObject(rgb);
Map.addLayer(rgb, {bands: ['B4', 'B3', 'B2'], min: 0, max: 20000}, 'rgb');
Thiết lập Python
Hãy xem trang
Môi trường Python để biết thông tin về API Python và cách sử dụng geemap
cho hoạt động phát triển tương tác.
import ee
import geemap.core as geemap
Colab (Python)
# All the GeoTiffs are in this folder.
uri_base = (
'gs://gcp-public-data-landsat/LC08/01/001/002/'
+ 'LC08_L1GT_001002_20160817_20170322_01_T2/'
)
# List of URIs, one for each band.
uris = ee.List([
uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B2.TIF',
uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B3.TIF',
uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B4.TIF',
uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF',
])
# Make a collection from the list of images.
images = uris.map(lambda uri: ee.Image.loadGeoTIFF(uri))
collection = ee.ImageCollection(images)
# Get an RGB image from the collection of bands.
rgb = collection.toBands().rename(['B2', 'B3', 'B4', 'B5'])
m = geemap.Map()
m.center_object(rgb)
m.add_layer(rgb, {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 20000}, 'rgb')
m
Tìm hiểu thêm về cách tải hình ảnh từ Cloud GeoTiff.
Tạo từ mảng Zarr v2
Tạo ImageCollection
từ một mảng Zarr v2 trong Bộ nhớ trên đám mây bằng cách lấy các lát cắt hình ảnh theo một phương diện cao hơn.
Ví dụ:
Trình soạn thảo mã (JavaScript)
var timeStart = 1000000;
var timeEnd = 1000048;
var zarrV2ArrayImages = ee.ImageCollection.loadZarrV2Array({
uri:
'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray',
proj: 'EPSG:4326',
axis: 0,
starts: [timeStart],
ends: [timeEnd]
});
print(zarrV2ArrayImages);
Map.addLayer(zarrV2ArrayImages, {min: -0.0001, max: 0.00005}, 'Evaporation');
Thiết lập Python
Hãy xem trang
Môi trường Python để biết thông tin về API Python và cách sử dụng geemap
cho hoạt động phát triển tương tác.
import ee
import geemap.core as geemap
Colab (Python)
time_start = 1000000
time_end = 1000048
zarr_v2_array_images = ee.ImageCollection.loadZarrV2Array(
uri='gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray',
proj='EPSG:4326',
axis=0,
starts=[time_start],
ends=[time_end],
)
display(zarr_v2_array_images)
m = geemap.Map()
m.add_layer(
zarr_v2_array_images, {'min': -0.0001, 'max': 0.00005}, 'Evaporation'
)
m
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eAn \u003ccode\u003eImageCollection\u003c/code\u003e in Earth Engine represents a sequence of images and can be loaded using an Earth Engine asset ID from the data catalog.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eImageCollection\u003c/code\u003es can be created using various methods, including \u003ccode\u003eee.ImageCollection()\u003c/code\u003e, \u003ccode\u003eee.ImageCollection.fromImages()\u003c/code\u003e, merging existing collections, or by mapping a function over a \u003ccode\u003eFeatureCollection\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUsers often filter large \u003ccode\u003eImageCollection\u003c/code\u003es, such as the Sentinel-2 surface reflectance collection, to focus on specific images of interest.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine allows creating \u003ccode\u003eImageCollection\u003c/code\u003es from GeoTIFFs stored in Cloud Storage by mapping \u003ccode\u003eee.Image.loadGeoTIFF\u003c/code\u003e over a list of URIs.\u003c/p\u003e\n"]]],["`ImageCollection` can be loaded using Earth Engine asset IDs, like 'COPERNICUS/S2_SR'. Collections can be created using `ee.ImageCollection()` or `ee.ImageCollection.fromImages()`, which take lists of images. Existing collections can be merged with the `merge()` method. `ImageCollection`s are also created by mapping a function over a `FeatureCollection` that returns an `Image`. Images can also be imported from GeoTIFF files in Cloud Storage, mapped and then put into an `ImageCollection`.\n"],null,["# ImageCollection Overview\n\nAn `ImageCollection` is a stack or sequence of images.\n\nConstruct from a collection ID\n------------------------------\n\nAn `ImageCollection` can be loaded by pasting an Earth Engine\nasset ID into the\n`ImageCollection` constructor. You can find\n`ImageCollection` IDs in the [data catalog](/earth-engine/datasets). For example, to load the\n[Sentinel-2 surface reflectance\ncollection](/earth-engine/guides/datasets/catalog/COPERNICUS_S2_SR):\n\n### Code Editor (JavaScript)\n\n```javascript\nvar sentinelCollection = ee.ImageCollection('COPERNICUS/S2_SR');\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\nsentinel_collection = ee.ImageCollection('COPERNICUS/S2_SR')\n```\n\nThis collection contains every Sentinel-2 image in the public catalog.\nThere are a lot. Usually you want to filter the collection as shown [here](/earth-engine/guides/ic_info) or\n[here](/earth-engine/guides/ic_filtering).\n\nConstruct from an image list\n----------------------------\n\nThe constructor\n`ee.ImageCollection()` or the convenience method\n`ee.ImageCollection.fromImages()` create image collections from\nlists of images. You can also create new image collections by merging\nexisting collections. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create arbitrary constant images.\nvar constant1 = ee.Image(1);\nvar constant2 = ee.Image(2);\n\n// Create a collection by giving a list to the constructor.\nvar collectionFromConstructor = ee.ImageCollection([constant1, constant2]);\nprint('collectionFromConstructor: ', collectionFromConstructor);\n\n// Create a collection with fromImages().\nvar collectionFromImages = ee.ImageCollection.fromImages(\n [ee.Image(3), ee.Image(4)]);\nprint('collectionFromImages: ', collectionFromImages);\n\n// Merge two collections.\nvar mergedCollection = collectionFromConstructor.merge(collectionFromImages);\nprint('mergedCollection: ', mergedCollection);\n\n// Create a toy FeatureCollection\nvar features = ee.FeatureCollection(\n [ee.Feature(null, {foo: 1}), ee.Feature(null, {foo: 2})]);\n\n// Create an ImageCollection from the FeatureCollection\n// by mapping a function over the FeatureCollection.\nvar images = features.map(function(feature) {\n return ee.Image(ee.Number(feature.get('foo')));\n});\n\n// Print the resultant collection.\nprint('Image collection: ', images);\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\n# Create arbitrary constant images.\nconstant_1 = ee.Image(1)\nconstant_2 = ee.Image(2)\n\n# Create a collection by giving a list to the constructor.\ncollection_from_constructor = ee.ImageCollection([constant_1, constant_2])\ndisplay('Collection from constructor:', collection_from_constructor)\n\n# Create a collection with fromImages().\ncollection_from_images = ee.ImageCollection.fromImages(\n [ee.Image(3), ee.Image(4)]\n)\ndisplay('Collection from images:', collection_from_images)\n\n# Merge two collections.\nmerged_collection = collection_from_constructor.merge(collection_from_images)\ndisplay('Merged collection:', merged_collection)\n\n# Create a toy FeatureCollection\nfeatures = ee.FeatureCollection(\n [ee.Feature(None, {'foo': 1}), ee.Feature(None, {'foo': 2})]\n)\n\n# Create an ImageCollection from the FeatureCollection\n# by mapping a function over the FeatureCollection.\nimages = features.map(lambda feature: ee.Image(ee.Number(feature.get('foo'))))\n\n# Display the resultant collection.\ndisplay('Image collection:', images)\n```\n\nNote that in this example an `ImageCollection` is created by\nmapping a function that returns an `Image` over a\n`FeatureCollection`. Learn more about mapping in the [Mapping over an ImageCollection section](/earth-engine/guides/ic_mapping). Learn\nmore about feature collections from the\n[FeatureCollection section](/earth-engine/guides/feature_collections).\n\nConstruct from a COG list\n-------------------------\n\nCreate an `ImageCollection` from GeoTiffs in Cloud Storage.\nFor example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// All the GeoTiffs are in this folder.\nvar uriBase = 'gs://gcp-public-data-landsat/LC08/01/001/002/' +\n 'LC08_L1GT_001002_20160817_20170322_01_T2/';\n\n// List of URIs, one for each band.\nvar uris = ee.List([\n uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B2.TIF',\n uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B3.TIF',\n uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B4.TIF',\n uriBase + 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF',\n]);\n\n// Make a collection from the list of images.\nvar images = uris.map(ee.Image.loadGeoTIFF);\nvar collection = ee.ImageCollection(images);\n\n// Get an RGB image from the collection of bands.\nvar rgb = collection.toBands().rename(['B2', 'B3', 'B4', 'B5']);\nMap.centerObject(rgb);\nMap.addLayer(rgb, {bands: ['B4', 'B3', 'B2'], min: 0, max: 20000}, 'rgb');\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\n# All the GeoTiffs are in this folder.\nuri_base = (\n 'gs://gcp-public-data-landsat/LC08/01/001/002/'\n + 'LC08_L1GT_001002_20160817_20170322_01_T2/'\n)\n\n# List of URIs, one for each band.\nuris = ee.List([\n uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B2.TIF',\n uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B3.TIF',\n uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B4.TIF',\n uri_base + 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF',\n])\n\n# Make a collection from the list of images.\nimages = uris.map(lambda uri: ee.Image.loadGeoTIFF(uri))\ncollection = ee.ImageCollection(images)\n\n# Get an RGB image from the collection of bands.\nrgb = collection.toBands().rename(['B2', 'B3', 'B4', 'B5'])\nm = geemap.Map()\nm.center_object(rgb)\nm.add_layer(rgb, {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 20000}, 'rgb')\nm\n```\n\n[Learn more about\nloading images from Cloud GeoTiffs](/earth-engine/guides/image_overview#images-from-cloud-geotiffs).\n\nConstruct from a Zarr v2 array\n------------------------------\n\nCreate an `ImageCollection` from a Zarr\nv2 array in Cloud Storage by taking image slices along a higher dimension.\nFor example:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar timeStart = 1000000;\nvar timeEnd = 1000048;\nvar zarrV2ArrayImages = ee.ImageCollection.loadZarrV2Array({\n uri:\n 'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray',\n proj: 'EPSG:4326',\n axis: 0,\n starts: [timeStart],\n ends: [timeEnd]\n});\n\nprint(zarrV2ArrayImages);\n\nMap.addLayer(zarrV2ArrayImages, {min: -0.0001, max: 0.00005}, 'Evaporation');\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\ntime_start = 1000000\ntime_end = 1000048\nzarr_v2_array_images = ee.ImageCollection.loadZarrV2Array(\n uri='gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray',\n proj='EPSG:4326',\n axis=0,\n starts=[time_start],\n ends=[time_end],\n)\n\ndisplay(zarr_v2_array_images)\n\nm = geemap.Map()\nm.add_layer(\n zarr_v2_array_images, {'min': -0.0001, 'max': 0.00005}, 'Evaporation'\n)\nm\n```"]]