公告:所有在
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 API 和如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
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
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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```"]]