Contour lines in GEE

Use this example to create your contour maps

Step 1: import the srtm digital elevation data.

Step 2: Create a geometry on your map

Step 3: use the code below to create contour lines.

var lines = ee.List.sequence(0, 4000, 200)

var contourlines = {
var mycontour = srtm
.convolve(ee.Kernel.gaussian(5, 3))

return mycontour.mask(mycontour);

contourlines = ee.ImageCollection(contourlines).mosaic()

Map.addLayer(contourlines, {min: 0, max: 5000, palette:['00ff00', 'ff0000']}, 'contours')

See an example here.

One comment

Leave a Reply