ee.Image.pixelLonLat
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างรูปภาพที่มี 2 แถบชื่อ "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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\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```"]]