Mapping Toolbox | ![]() ![]() |
Working with the Globe Projection
Projection is the process of transforming coordinates from the round spherical coordinate system to flat Cartesian coordinates. The basic assumption of most projections in the Mapping Toolbox is that latitudes and longitudes map to x- and y-coordinates. The single exception is the globe projection, which maps latitudes and longitudes to points on a sphere in Earth-centered Cartesian (x-,y-,z-) coordinates. This makes the globe useful in applications where the proper three-dimensional relationship between objects is important. The following examples illustrate the difference between the two-dimensional orthographic projection, which looks like a globe but is really flat, and the three-dimensional globe
load topo axesm ortho; framem meshm(topo,topolegend);demcmap(topo) view(3); daspectm('m',1) [latgrat,longrat] = meshgrat(topo,topolegend,[20 20]); stem3m(latgrat,longrat,500000*ones(size(latgrat)),'r') figure axesm('globe','Geoid',almanac('earth','radius','m')) meshm(topo,topolegend); demcmap(topo) view(3) [latgrat,longrat] = meshgrat(topo,topolegend,[20 20]); stem3m(latgrat,longrat,500000*ones(size(latgrat)),'r') light
Because the globe is three-dimensional, having an opaque surface underneath vector data helps to hide lines on the other side of the globe. The following example shows how you can display lines on an underlying surface and use camera position functions to control the view. To make the surface of the globe one color, change the FaceColor
property of the topo
surface.
figure; axesm('globe','galt',0) gridm('GLineStyle','-') load topo hs = meshm(topo,topolegend,size(topo)); hl = displaym(worldlo('POline')); set(hl,'color','k') demcmap(topo); camlight; material(0.6*[ 1 1 1]) [tlat,tlon] = extractm(worldlo('gazette'),'Moscow'); [plat,plon] = extractm(worldlo('gazette'),'Washington'); camtargm(tlat,tlon,0); camposm(plat,plon,3) camupm(tlat,tlon); camva(20) hidem(gca)
![]() | Projection Computations | Working with the UTM projection | ![]() |