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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s