Surface Relief Shading
You can make dimensional monochrome shaded-relief maps with the
surflm function, which is similar to the
surfl function. The effect of
surflm is similar to
using lights, but the function models illumination itself (with one “light
source” that you specify when you invoke it, but cannot reposition) by weighting
surface normals rather than using light objects.
Shaded relief maps of this type are usually portrayed two-dimensionally rather than as
perspective displays. The
surflm function works with any projection
surflm function accepts geolocated data grids only. Recall,
however, that regular data grids are a subset of geolocated data grids, to which they
can be converted using the
geographicGrid function. The following example illustrates this
Create Monochrome Shaded Relief Map
Simulate a single light source in a figure using
surflm. First, load elevation data and a geographic cells reference object for the Korean peninsula. Import coastline vector data using
shaperead. Create a map with appropriate latitude and longitude limits using
load korea5c latlim = korea5cR.LatitudeLimits; lonlim = korea5cR.LongitudeLimits; coastline = shaperead('landareas.shp',... 'UseGeoCoords', true,... 'BoundingBox', [lonlim' latlim']); worldmap(latlim,lonlim)
Display the coastline data using
Transform the regular data grid to a geolocated data grid using the
geographicGrid function. Then, generate a shaded relief map using
surflm. By default, the lighting direction is 45º counterclockwise from the viewing direction. Therefore, the light source is in the southeast. Change the colormap to the monochromatic colormap
[klat,klon] = geographicGrid(korea5cR); s = surflm(klat,klon,korea5c); colormap('copper')
Clear the map. Then, display the shaded relief map with a different light source by specifying the azimuth as 135º and the elevation as 60º. The surface lightens and has a new character because it is lit closer to overhead and from a different direction.
clmo(s) s = surflm(klat,klon,korea5c,[135 60]);
Shift the light to the northwest by specifying the azimuth as -135º. Lower the light to 40º above the horizon. A lower light source decreases the overall reflectance of the surface when viewed from above. Therefore, specify a 1-by-4 vector of reflectance constants that describe the relative contributions of ambient light, diffuse reflection, specular reflection, and the specular shine coefficient.
clmo(s); ht = surflm(klat,klon,korea5c,[-135 30],[0.65 0.4 0.3 10]);
The mountain ridges that run from northeast to southwest are approximately perpendicular to the light source. Therefore, these parameters demonstrate appropriate lighting for the terrain.
The monochromatic coloration in this example does not differentiate land from water. For an example that differentiates land from water, see Colored Surface Shaded Relief.