ee.Image.pixelLonLat
Creates an image with two bands named 'longitude' and 'latitude', containing the longitude and latitude at each pixel, in degrees.
Usage | Returns |
---|
ee.Image.pixelLonLat() | Image |
No arguments.
Examples
// 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 setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
# 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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Generates an image containing pixel-wise longitude and latitude values in degrees, accessible via two bands named 'longitude' and 'latitude'."],["The function `ee.Image.pixelLonLat()` is used to create this image, requiring no arguments."],["This image can be utilized for various geospatial analyses, such as calculating UTM zones as shown in the examples."]]],["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"]]