Retrieving and visualizing elevation data

Keep the previous script open from ‘Processing & Cloud Masking Sentinel’, we will continue in this section

This exercise will walk us to the use of the NASADEM elevation dataset. Let’s remember that each product description in the GEE catalog usually brings a small portion of code to exemplify how to use it. We look for the product:

Figure 24. NASA Digital Elevation Model (DEM) listed options

The first product listed must be imported, and change the name to ‘nasadem’.

Figure 25. NASA DEM description

It’s always important to skim over the dataset product details, such as time availability, spatial scope, significant improvements over other options, and bands.

Figure 26. Product added

//	NASA Digital Elevation Model (DEM)  
var elevation = nasadem.select('elevation');
// Set elevation <= 0 as transparent and add to the map.
elevation = elevation.updateMask(elevation.gt(0)).clip(barbados_bou);


// Set elevation visualization properties.
var elevationVis = {
  min: 0,
  max: 400,
};

Map.addLayer(elevation, elevationVis, 'Elevation');

Elevations in the interior range from 180 to 240 meters above sea level. Mount Hillaby is the highest point at 340 meters above sea level. Source

Figure 27. Mount Hillaby, Barbados. Source

// Around Mt Hillaby
var p01 = ee.Geometry.Point(-59.58463, 13.2018)

Map.addLayer(p01, {color:'red'}, 'point');
Map.centerObject(p01,12)

Figure 28. DEM layer and the location over El Cerro Del Aripo mountain

Black and gray colors correspond to lowlands and plains, while white and bright pixels correspond to highlands and mountain peaks. We are going to use the Inspector tool. Click on it, and then we click on the point we added in order to see the elevation value we have there.

Figure 29. Inspector panel.

Hence, the values from all the add layers will be visible for the specified geographical location.

Figure 30. Location values

In the Inspector panel we will see the values for the layers we have added by code, either activated or deactivated. First, we can identify low surface reflectance values from the Sentinel layer. Second, we can observe that the elevation at this location is 901 meters. Let’s do a quick exercise of visualization. The default view of the map visor

Figure 31. Visualization mode.

We can make use of the high-resolution images available in a true color setting to visualize the area and try to identify mountainous zones.

Figure 32. Visualization using high-resolution basemaps of GEE

We can also use the Map-terrain view to analyze elevation by contour lines

Figure 33. Map terrain view

Figure 34. Terrain view

We can easily recognize our point of reference located at the 900 m contour line.

Code Checkpoint: https://code.earthengine.google.com/6e6dfe82c96ad645548d92f3bd09d40f