I am trying to use GEE to make maps intended for use on trails with compasses. I have already managed to place the contour lines but I couldn't put the grids with UTM coordinates.
1 Answer
You can access the coordinates for any projection using ee.Image.pixelCoordinates. Then with a little math, you can turn that into a grid. Set the projection scale to select how close together you want them. These are at 1km.
var proj = ee.Projection("EPSG:32612").atScale(1000)
var coords = ee.Image.pixelCoordinates(proj)
Map.addLayer(coords.subtract(coords.round()).zeroCrossing().reduce('sum').selfMask())
-
Thank you! Helped a lot! Now a new doubt: Do You know how I can put the coordinates in a box? Like this: imagemhost.com.br/image/2yfenC This is my box: imagemhost.com.br/image/2yfdpw Hope you can help again. Script: code.earthengine.google.com/42641a7fa898f566663686cbcec33d52 Commented Apr 18, 2021 at 0:29