סקירה כללית על תמונות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כפי שצוין במאמר תחילת העבודה, נתוני רסטר מיוצגים כאובייקטים מסוג Image
ב-Earth Engine. תמונות מורכבות מפס אחד או יותר, וכל פס כולל שם, סוג נתונים, קנה מידה, מסכה ותצוגה משלו. לכל תמונה יש מטא-נתונים שמאוחסנים כקבוצה של מאפיינים.
ה-constructor של ee.Image
כדי לטעון תמונות, מדביקים מזהה נכס של Earth Engine ב-constructor של ee.Image
. מזהי התמונות מופיעים בקטלוג הנתונים.
לדוגמה, לדגם דיגיטלי של גובה (NASADEM):
Code Editor (JavaScript)
var loadedImage = ee.Image('NASA/NASADEM_HGT/001');
הגדרת Python
בדף
סביבת Python מפורט מידע על Python API ועל השימוש ב-geemap
לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
loaded_image = ee.Image('NASA/NASADEM_HGT/001')
הערה: אפשר גם לחפש תמונה באמצעות כלי החיפוש של Code Editor. כשמייבאים את הנכס, קוד היצירה של התמונה נכתב בשבילכם בקטע imports ב-Code Editor. אפשר גם להשתמש במזהה נכס אישי כארגומנטים למבנה ee.Image
.
אחזור ee.Image
מ-ee.ImageCollection
הדרך הרגילה להוציא תמונה מאוסף היא לסנן את האוסף, עם מסננים לפי סדר ירידה ברמת הספציפיות. לדוגמה, כדי לקבל תמונה מאוסף הנתונים של החזרת אור מפני השטח של Sentinel-2:
Code Editor (JavaScript)
var first = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(ee.Geometry.Point(-70.48, 43.3631))
.filterDate('2019-01-01', '2019-12-31')
.sort('CLOUDY_PIXEL_PERCENTAGE')
.first();
Map.centerObject(first, 11);
Map.addLayer(first, {bands: ['B4', 'B3', 'B2'], min: 0, max: 2000}, 'first');
הגדרת Python
בדף
סביבת Python מפורט מידע על Python API ועל השימוש ב-geemap
לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
first = (
ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(ee.Geometry.Point(-70.48, 43.3631))
.filterDate('2019-01-01', '2019-12-31')
.sort('CLOUDY_PIXEL_PERCENTAGE')
.first()
)
# Define a map centered on southern Maine.
m = geemap.Map(center=[43.7516, -70.8155], zoom=11)
# Add the image layer to the map and display it.
m.add_layer(
first, {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 2000}, 'first'
)
display(m)
חשוב לזכור שהמיון מתבצע אחרי המסננים. מומלץ להימנע ממיון של כל האוסף.
תמונות מקובצי GeoTIFF ב-Cloud
אפשר להשתמש ב-ee.Image.loadGeoTIFF()
כדי לטעון תמונות מ-GeoTIFFs שהותאמו ל-Cloud ב-Google Cloud Storage.
לדוגמה, מערך הנתונים הציבורי של Landsat שמתארח ב-Google Cloud מכיל את קובץ GeoTIFF הזה, שתואם לפס 5 מסצנה של Landsat 8. אפשר לטעון את התמונה הזו מ-Cloud Storage באמצעות ee.Image.loadGeoTIFF()
:
Code Editor (JavaScript)
var uri = 'gs://gcp-public-data-landsat/LC08/01/001/002/' +
'LC08_L1GT_001002_20160817_20170322_01_T2/' +
'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF';
var cloudImage = ee.Image.loadGeoTIFF(uri);
print(cloudImage);
הגדרת Python
בדף
סביבת Python מפורט מידע על Python API ועל השימוש ב-geemap
לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
uri = (
'gs://gcp-public-data-landsat/LC08/01/001/002/'
+ 'LC08_L1GT_001002_20160817_20170322_01_T2/'
+ 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF'
)
cloud_image = ee.Image.loadGeoTIFF(uri)
display(cloud_image)
שימו לב: אם רוצים לטעון מחדש קובץ GeoTIFF מותאם ל-Cloud שמייצאים מ-Earth Engine ל-Cloud Storage, צריך להגדיר את הערך של cloudOptimized
ל-true בזמן הייצוא, כפי שמתואר כאן.
תמונות מערכי Zarr v2
אפשר להשתמש ב-ee.Image.loadZarrV2Array()
כדי לטעון תמונה ממערך Zarr v2 ב-Google Cloud Storage. לדוגמה, מערך הנתונים הציבורי ERA5 שמתארח ב-Google Cloud מכיל את מערך Zarr v2 הזה, שתואם למטרים של מים שהתאדו מפני כדור הארץ. אפשר לטעון את המערך הזה מ-Cloud Storage באמצעות ee.Image.loadZarrV2Array()
:
Code Editor (JavaScript)
var timeStart = 1000000;
var timeEnd = 1000010;
var zarrV2ArrayImage = ee.Image.loadZarrV2Array({
uri:
'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray',
proj: 'EPSG:4326',
starts: [timeStart],
ends: [timeEnd]
});
print(zarrV2ArrayImage);
Map.addLayer(zarrV2ArrayImage, {min: -0.0001, max: 0.00005}, 'Evaporation');
הגדרת Python
בדף
סביבת Python מפורט מידע על Python API ועל השימוש ב-geemap
לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
time_start = 1000000
time_end = 1000010
zarr_v2_array_image = ee.Image.loadZarrV2Array(
uri='gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray',
proj='EPSG:4326',
starts=[time_start],
ends=[time_end],
)
display(zarr_v2_array_image)
m.add_layer(
zarr_v2_array_image, {'min': -0.0001, 'max': 0.00005}, 'Evaporation'
)
m
תמונות קבועות
בנוסף לטעינה של תמונות לפי מזהה, אפשר גם ליצור תמונות מתוך קבועים, רשימות או אובייקטים מתאימים אחרים ב-Earth Engine. בהמשך מפורטות שיטות ליצירת תמונות, לקבלת קבוצות משנה של פסים ולשינוי שלהם:
Code Editor (JavaScript)
// Create a constant image.
var image1 = ee.Image(1);
print(image1);
// Concatenate two images into one multi-band image.
var image2 = ee.Image(2);
var image3 = ee.Image.cat([image1, image2]);
print(image3);
// Create a multi-band image from a list of constants.
var multiband = ee.Image([1, 2, 3]);
print(multiband);
// Select and (optionally) rename bands.
var renamed = multiband.select(
['constant', 'constant_1', 'constant_2'], // old names
['band1', 'band2', 'band3'] // new names
);
print(renamed);
// Add bands to an image.
var image4 = image3.addBands(ee.Image(42));
print(image4);
הגדרת Python
בדף
סביבת Python מפורט מידע על Python API ועל השימוש ב-geemap
לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
# Create a constant image.
image_1 = ee.Image(1)
display(image_1)
# Concatenate two images into one multi-band image.
image_2 = ee.Image(2)
image_3 = ee.Image.cat([image_1, image_2])
display(image_3)
# Create a multi-band image from a list of constants.
multiband = ee.Image([1, 2, 3])
display(multiband)
# Select and (optionally) rename bands.
renamed = multiband.select(
['constant', 'constant_1', 'constant_2'], # old names
['band1', 'band2', 'band3'], # new names
)
display(renamed)
# Add bands to an image.
image_4 = image_3.addBands(ee.Image(42))
display(image_4)
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[[["\u003cp\u003eIn Earth Engine, raster data is represented as \u003ccode\u003eImage\u003c/code\u003e objects, which can be created by loading existing assets or by defining them with constant values.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eImage\u003c/code\u003e objects can be created from Earth Engine assets, \u003ccode\u003eImageCollection\u003c/code\u003e objects, and Cloud Optimized GeoTIFFs (COG) stored in Google Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eImages in Earth Engine are composed of bands, each with its own data type, scale, mask, and projection, and images can be manipulated using methods such as \u003ccode\u003eselect\u003c/code\u003e, \u003ccode\u003eaddBands\u003c/code\u003e, and \u003ccode\u003ecat\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eImageCollection\u003c/code\u003e objects can be filtered and sorted to retrieve specific images, and \u003ccode\u003eee.Image.loadGeoTIFF()\u003c/code\u003e is used to load images from Cloud Optimized GeoTIFFs in Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eConstant images can be created from numerical values, lists of values, and other suitable Earth Engine objects, allowing for flexible image manipulation and analysis.\u003c/p\u003e\n"]]],[],null,["# Image Overview\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| [Run in Google Colab](https://colab.research.google.com/github/google/earthengine-community/blob/master/guides/linked/generated/image_overview.ipynb) | [View source on GitHub](https://github.com/google/earthengine-community/blob/master/guides/linked/generated/image_overview.ipynb) |\n\nAs mentioned in the [Get Started](/earth-engine/guides/getstarted#earth-engine-data-structures)\ndoc, raster data are represented as `Image` objects in Earth Engine. Images are\ncomposed of one or more bands and each band has its own name, data type, scale, mask\nand projection. Each image has metadata stored as a set of properties.\n\n`ee.Image` constructor\n----------------------\n\nImages can be loaded by pasting an Earth Engine asset ID into the `ee.Image`\nconstructor. You can find image IDs in the [data catalog](/earth-engine/datasets).\nFor example, to a digial elevation model ([NASADEM](/earth-engine/datasets/catalog/NASA_NASADEM_HGT_001)):\n\n### Code Editor (JavaScript)\n\n```javascript\nvar loadedImage = ee.Image('NASA/NASADEM_HGT/001');\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\nloaded_image = ee.Image('NASA/NASADEM_HGT/001')\n```\n\n\nNote that finding an image through\n[the Code Editor search tool](/earth-engine/guides/playground#search-tool)\nis equivalent. When you import the asset, the image construction code is written\nfor you in the [imports section of the\nCode Editor](/earth-engine/guides/playground#imports). You can also use a personal\n[asset ID](/earth-engine/guides/manage_assets#asset_id) as the argument to the\n`ee.Image` constructor.\n\nGet an `ee.Image` from an `ee.ImageCollection`\n----------------------------------------------\n\n\nThe standard way to get an image out of a collection is to filter the collection, with\nfilters in order of decreasing specificity. For example, to get an image out of the\n[Sentinel-2 surface reflectance collection](/earth-engine/datasets/catalog/COPERNICUS_S2_SR):\n\n### Code Editor (JavaScript)\n\n```javascript\nvar first = ee.ImageCollection('COPERNICUS/S2_SR')\n .filterBounds(ee.Geometry.Point(-70.48, 43.3631))\n .filterDate('2019-01-01', '2019-12-31')\n .sort('CLOUDY_PIXEL_PERCENTAGE')\n .first();\nMap.centerObject(first, 11);\nMap.addLayer(first, {bands: ['B4', 'B3', 'B2'], min: 0, max: 2000}, 'first');\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\nfirst = (\n ee.ImageCollection('COPERNICUS/S2_SR')\n .filterBounds(ee.Geometry.Point(-70.48, 43.3631))\n .filterDate('2019-01-01', '2019-12-31')\n .sort('CLOUDY_PIXEL_PERCENTAGE')\n .first()\n)\n\n# Define a map centered on southern Maine.\nm = geemap.Map(center=[43.7516, -70.8155], zoom=11)\n\n# Add the image layer to the map and display it.\nm.add_layer(\n first, {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 2000}, 'first'\n)\ndisplay(m)\n```\n\n\nNote that the sort is *after* the filters. Avoid sorting the entire collection.\n\nImages from Cloud GeoTIFFs\n--------------------------\n\n\nYou can use `ee.Image.loadGeoTIFF()` to load images from\n[Cloud Optimized\nGeoTIFFs](https://github.com/cogeotiff/cog-spec/blob/master/spec.md) in [Google Cloud Storage](https://cloud.google.com/storage).\nFor example, the\n[public\nLandsat dataset](https://console.cloud.google.com/marketplace/details/usgs-public-data/landast) hosted in Google Cloud contains\n[this\nGeoTIFF](https://console.cloud.google.com/storage/browser/_details/gcp-public-data-landsat/LC08/01/001/002/LC08_L1GT_001002_20160817_20170322_01_T2/LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF), corresponding to band 5 from a Landsat 8 scene. You can load this image from\nCloud Storage using `ee.Image.loadGeoTIFF()`:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar uri = 'gs://gcp-public-data-landsat/LC08/01/001/002/' +\n 'LC08_L1GT_001002_20160817_20170322_01_T2/' +\n 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF';\nvar cloudImage = ee.Image.loadGeoTIFF(uri);\nprint(cloudImage);\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\nuri = (\n 'gs://gcp-public-data-landsat/LC08/01/001/002/'\n + 'LC08_L1GT_001002_20160817_20170322_01_T2/'\n + 'LC08_L1GT_001002_20160817_20170322_01_T2_B5.TIF'\n)\ncloud_image = ee.Image.loadGeoTIFF(uri)\ndisplay(cloud_image)\n```\n\n\nNote that if you want to reload a Cloud Optimized GeoTIFF that you\n[export from Earth Engine to\nCloud Storage](/earth-engine/guides/exporting#to-cloud-storage), when you do the export, set\n`cloudOptimized` to **true** as\ndescribed [here](/earth-engine/guides/exporting#configuration-parameters).\n\nImages from Zarr v2 arrays\n--------------------------\n\n\nYou can use `ee.Image.loadZarrV2Array()` to load an image from a\n[Zarr v2 array](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html) in\n[Google Cloud Storage](https://cloud.google.com/storage). For example, the public\nERA5 dataset hosted in Google Cloud contains\n[this Zarr v2 array](https://console.cloud.google.com/storage/browser/_details/gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3/evaporation/.zarray),\ncorresponding to meters of water that has evaporated from the Earth's surface. You can load\nthis array from Cloud Storage using `ee.Image.loadZarrV2Array()`:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar timeStart = 1000000;\nvar timeEnd = 1000010;\nvar zarrV2ArrayImage = ee.Image.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 starts: [timeStart],\n ends: [timeEnd]\n});\nprint(zarrV2ArrayImage);\nMap.addLayer(zarrV2ArrayImage, {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 = 1000010\nzarr_v2_array_image = ee.Image.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 starts=[time_start],\n ends=[time_end],\n)\n\ndisplay(zarr_v2_array_image)\n\nm.add_layer(\n zarr_v2_array_image, {'min': -0.0001, 'max': 0.00005}, 'Evaporation'\n)\nm\n```\n\nConstant images\n---------------\n\nIn addition to loading images by ID, you can also create images\nfrom constants, lists or other suitable Earth Engine objects. The following illustrates\nmethods for creating images, getting band subsets, and manipulating bands:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create a constant image.\nvar image1 = ee.Image(1);\nprint(image1);\n\n// Concatenate two images into one multi-band image.\nvar image2 = ee.Image(2);\nvar image3 = ee.Image.cat([image1, image2]);\nprint(image3);\n\n// Create a multi-band image from a list of constants.\nvar multiband = ee.Image([1, 2, 3]);\nprint(multiband);\n\n// Select and (optionally) rename bands.\nvar renamed = multiband.select(\n ['constant', 'constant_1', 'constant_2'], // old names\n ['band1', 'band2', 'band3'] // new names\n);\nprint(renamed);\n\n// Add bands to an image.\nvar image4 = image3.addBands(ee.Image(42));\nprint(image4);\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 a constant image.\nimage_1 = ee.Image(1)\ndisplay(image_1)\n\n# Concatenate two images into one multi-band image.\nimage_2 = ee.Image(2)\nimage_3 = ee.Image.cat([image_1, image_2])\ndisplay(image_3)\n\n# Create a multi-band image from a list of constants.\nmultiband = ee.Image([1, 2, 3])\ndisplay(multiband)\n\n# Select and (optionally) rename bands.\nrenamed = multiband.select(\n ['constant', 'constant_1', 'constant_2'], # old names\n ['band1', 'band2', 'band3'], # new names\n)\ndisplay(renamed)\n\n# Add bands to an image.\nimage_4 = image_3.addBands(ee.Image(42))\ndisplay(image_4)\n```"]]