公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Image.loadGeoTIFF
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
以圖片形式載入 GeoTIFF。
用量 | 傳回 |
---|
ee.Image.loadGeoTIFF(uri) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
uri | 字串 | 要載入的 GeoTIFF 的 Cloud Storage URI。必須能夠存取值區中繼資料 (需要「Storage 舊版值區讀取者」角色提供的 `storage.buckets.get` 權限,請參閱 https://cloud.google.com/storage/docs/access-control/iam-roles),且值區必須位於美國多地區、包含 US-CENTRAL1 的雙地區,或 US-CENTRAL1 地區。 |
範例
程式碼編輯器 (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);
Map.addLayer(cloudImage, {min: 0, max: 20000});
Map.centerObject(cloudImage, 6);
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)
m = geemap.Map()
m.add_layer(cloud_image, {'min': 0, 'max': 20000})
m.center_object(cloud_image, 6)
m
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eee.Image.loadGeoTIFF\u003c/code\u003e loads a Cloud Storage-hosted GeoTIFF file as an \u003ccode\u003eee.Image\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe function takes a single argument, \u003ccode\u003euri\u003c/code\u003e, which specifies the Cloud Storage location of the GeoTIFF.\u003c/p\u003e\n"],["\u003cp\u003eExamples demonstrate loading and displaying a Landsat 8 GeoTIFF from the public data catalog in both JavaScript and Python.\u003c/p\u003e\n"]]],["The function `ee.Image.loadGeoTIFF(uri)` loads a GeoTIFF from a Cloud Storage URI as an `Image`. The `uri` must be a string pointing to a GeoTIFF file in a supported Google Cloud Storage bucket, requiring specific access permissions. Example code is provided for both JavaScript and Python, demonstrating loading, printing, and displaying the GeoTIFF. The Python code uses `geemap` for interactive development. The loaded image can then be used in further processing and analysis.\n"],null,["# ee.Image.loadGeoTIFF\n\nLoads a GeoTIFF as an Image.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------|---------|\n| `ee.Image.loadGeoTIFF(uri)` | Image |\n\n| Argument | Type | Details |\n|----------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `uri` | String | The Cloud Storage URI of the GeoTIFF to load. The bucket metadata must be accessible (requires the \\`storage.buckets.get\\` permission which is provided by the role \"Storage Legacy Bucket Reader\" among others, see https://cloud.google.com/storage/docs/access-control/iam-roles) and the bucket must be located in the US multi-region, a dual-region including US-CENTRAL1, or the US-CENTRAL1 region. |\n\nExamples\n--------\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);\n\nprint(cloudImage);\n\nMap.addLayer(cloudImage, {min: 0, max: 20000});\nMap.centerObject(cloudImage, 6);\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/'\n + '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)\n\ndisplay(cloud_image)\n\nm = geemap.Map()\nm.add_layer(cloud_image, {'min': 0, 'max': 20000})\nm.center_object(cloud_image, 6)\nm\n```"]]