公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.loadGeoTIFF
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将 GeoTIFF 加载为图片。
用法 | 返回 |
---|
ee.Image.loadGeoTIFF(uri) | 图片 |
参数 | 类型 | 详细信息 |
---|
uri | 字符串 | 要加载的 GeoTIFF 的 Cloud Storage URI。必须能够访问存储分区元数据(需要“Storage Legacy Bucket Reader”等角色提供的“storage.buckets.get”权限,请参阅 https://cloud.google.com/storage/docs/access-control/iam-roles),并且存储分区必须位于美国多区域、双区域(包括 US-CENTRAL1)或 US-CENTRAL1 区域。 |
示例
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);
Map.addLayer(cloudImage, {min: 0, max: 20000});
Map.centerObject(cloudImage, 6);
Python 设置
如需了解 Python API 以及如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
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
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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```"]]