Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 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```"]]