Mapping Toolbox | ![]() ![]() |
Draping Data on Elevation Maps
Lighting effects are also helpful when elevation maps are combined with other kinds of data. The shading resulting from lighting effects provides the necessary visual cues when you drape satellite data on a grid of elevations. This kind of display is commonly used to combine topography from digital elevation models with land use images from remote sensing satellites such as LANDSAT and SPOT. Such displays can also be created with the Mapping Toolbox.
If the elevation and color matrices correspond pixel-for-pixel to the same geographic locations, such a display can be created using the optional altitude arguments in the surface display commands. The following example shows the Earth's geoid draped on the corresponding topography. The geoid can be described as the surface of the ocean in the absence of waves, tides, or land obstructions. The geoid is influenced by the gravitational attraction of denser or lighter materials in the Earth's crust and by the shape of the crust. The geoid is also important in surveying because it defines the direction of "up," from which is measured the geodetic latitude. The geoid heights vary from a minimum of about 105 meters below sea-level, shown in blue, to a maximum of about 85 meters above sea-level, shown in red. You can see that the geoid mirrors the topography of the major mountain chains such as the Andes, the Himalayas, and the Mid-Atlantic Ridge. You can also see that large areas of high or low geoid heights are not simply a result of topography.
load topo load geoid axesm gstereo meshm(geoid,geoidlegend,size(geoid),topo) plotm(coast,'k') zdatam(handlem('allline'),1000) % keep lines above surface daspectm('m',200); tightmap view(20,35) camlight; lighting phong set(gca,'projection','perspective') % allow axes to converge
If your elevation and color data is based on different graticules, you must construct a new version of one matrix that is consistent with the other. Suppose you have elevation data that is in a regular matrix map and color data in a general matrix map. One approach is to interpolate elevation values for the general matrix map graticule. For example, if your elevation map is topo
and topolegend
, and the color data is the curvature of the diamond-shaped general matrix map in the mapmtx
MAT-file, lt1
, lg1
, and del2(map1)
, you can create a diamond-shaped map of elevations using ltln2val
. When you use ltln2val
for this purpose, it is important that the regular matrix map of elevations completely covers the area of the general matrix map. The four matrices can then be combined in a surface display. Notice how the greatest curvature values, shown in red, are found at the continental margins of Africa and where the Indian plains meet the Himalayas.
load topo load mapmtx map1z = ltln2val(topo,topolegend,lt1,lg1); figure axesm miller surfm(lt1,lg1,del2(map1),map1z) view(10,30); daspectm('m',100) material shiny;camlight;lighting phong axis tight; set(gca,'Projection','Perspective')
Alternatively, you can construct a regular matrix map version of your general matrix map color data. First, create a new regular matrix map that covers the region of the general matrix map, then imbed the color data values into the new matrix. The new matrix may need to be somewhat lower in resolution than the original, to ensure that every cell in the new map receives a value. The advantage of this approach is that a host of computational functions can be used with the resulting regular matrix map. This example also illustrates the fact that the color and elevation matrices do not have to be the same size. If the resolution of the two is different, you can create the surface as a three-dimensional elevation map and later apply the colors. You do this by setting the surface Cdata
property to contain the color matrix, and setting the surface face color to 'TextureMap
'.
load topo; load mapmtx latlim = [min(lt1(:)) max(lt1(:))]; lonlim = [min(lg1(:)) max(lg1(:))]; [smalltopo,smalltopoleg] = maptrims(topo,topolegend,... latlim,lonlim); [smalltopocurv,smalltopocurvleg] = nanm(latlim,lonlim,.5); % 1/.5 cells per degree scale smalltopocurv = imbedm(lt1,lg1,del2(map1),... smalltopocurv,smalltopocurvleg); figure; axesm miller h = meshm(smalltopo,smalltopoleg,size(smalltopo),smalltopo); view(10,30); daspectm('m',100) material shiny; camlight; lighting phong axis tight; set(gca,'Projection','Perspective') set(h,'Cdata',smalltopocurv,'FaceColor','TextureMap') ltln2val(smalltopocurv,smalltopocurvleg,39,76.3) ans = 1.9238e+03
![]() | Mapped Light Objects | The Geographic Data Structure | ![]() |