公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Image.pixelLonLat
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立含有兩個名為「longitude」和「latitude」的波段的圖片,其中包含每個像素的經緯度 (以度為單位)。
用量 | 傳回 |
---|
ee.Image.pixelLonLat() | 圖片 |
沒有引數。
範例
程式碼編輯器 (JavaScript)
// https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system
var longitude = ee.Image.pixelLonLat().select('longitude');
var utmZones = longitude.add(180).divide(6).int();
Map.addLayer(utmZones, {min:0, max: 60}, 'UTM zones');
Python 設定
請參閱
Python 環境頁面,瞭解 Python API 和如何使用 geemap
進行互動式開發。
import ee
import geemap.core as geemap
Colab (Python)
# https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system
longitude = ee.Image.pixelLonLat().select('longitude')
utm_zones = longitude.add(180).divide(6).int()
m = geemap.Map()
m.add_layer(utm_zones, {'min': 0, 'max': 60}, 'UTM zones')
m
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eGenerates an image containing pixel-wise longitude and latitude values in degrees, accessible via two bands named 'longitude' and 'latitude'.\u003c/p\u003e\n"],["\u003cp\u003eThe function \u003ccode\u003eee.Image.pixelLonLat()\u003c/code\u003e is used to create this image, requiring no arguments.\u003c/p\u003e\n"],["\u003cp\u003eThis image can be utilized for various geospatial analyses, such as calculating UTM zones as shown in the examples.\u003c/p\u003e\n"]]],["The `ee.Image.pixelLonLat()` function generates an image with 'longitude' and 'latitude' bands, representing the geographic coordinates at each pixel. This image can be further processed, for example, to calculate UTM zones by adding 180 to the longitude, dividing by 6, and converting to integers. The function has no arguments and is used in both JavaScript and Python.\n"],null,["# ee.Image.pixelLonLat\n\nCreates an image with two bands named 'longitude' and 'latitude', containing the longitude and latitude at each pixel, in degrees.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------|---------|\n| `ee.Image.pixelLonLat()` | Image |\n\n**No arguments.**\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system\nvar longitude = ee.Image.pixelLonLat().select('longitude');\nvar utmZones = longitude.add(180).divide(6).int();\nMap.addLayer(utmZones, {min:0, max: 60}, 'UTM zones');\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# https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system\nlongitude = ee.Image.pixelLonLat().select('longitude')\nutm_zones = longitude.add(180).divide(6).int()\nm = geemap.Map()\nm.add_layer(utm_zones, {'min': 0, 'max': 60}, 'UTM zones')\nm\n```"]]