⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapug.html

📁 m_map是加拿大学者编写的一个在matlab上绘地图的软件
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <title>M_Map: A Mapping package for Matlab</title></head><body style="background-color: rgb(255, 245, 238);"><h1 align="center">M_Map: User's Guide v1.4 </h1><hr><center> <img src="./mlogo.gif"> </center><br><hr><h2><a name="1._Getting_started_"></a> <a name="p1">1. Getting started</a> </h2><p> First, get all the files, either as a <a href="http://www.eos.ubc.ca/%7Erich/m_map1.4.zip"> zip archive </a>ora <a href="http://www.eos.ubc.ca/%7Erich/m_map1.4.tar.gz"> gzippedtar-file </a>and unpack them. If you are unpacking the zip file MAKESURE YOU ALSO UNPACK SUBDIRECTORIES! Now, start up Matlab (version 5 orhigher). Make sure that the toolbox is in your path. This can be donesimply by <code>cd</code>'ing to the correct directory. </p><p> Alternatively, if you have unpacked them into directory <code>/users/rich/m_map</code>(and <code>/users/rich/m_map/private</code>), then you can add this toyour search path: </p><pre>path(path,'/users/rich/m_map');<br></pre>or<pre>addpath /users/rich/m_map<br></pre>To follow along with this document, you would then use a Web-browser toopen <a href="./mapug.html"><code>file:/users/rich/m_map/map.html</code></a>,that is, this HTML document.<p> Note: you may want to install M_Map as a toolbox accessible to allusers. To do this, unpack the files into $MATLAB/toolbox/m_map, addthatdirectory to the list defined in $MATLAB/toolbox/local/pathdef.m, andupdatethe cache file using </p><pre>rehash toolboxcache</pre><p> Instructions for installing the (optional) high-resolutionbathymetry database are given in <a href="#p9"> Section 9 </a>, andinstructionsfor installing the (optional) high-resolution GSHHS coastline databaseis given in <a href="#p9.5"> Section 10 </a>. However, we shouldfirstcheck that the basic setup is OK. </p><p> To see an example map, try this: </p><pre>m_proj('oblique mercator');<br>m_coast;<br>m_grid;<br></pre>This is a line map of the Oregon/British Columbia coast, using anOblique Mercator projection (A few more complex maps can be generatedby running the demo function <code>m_demo</code>).<p> The first line initializes the projection. Defaults are set for thedifferent projection, so you can easily see what a specific projectionlookslike, but all projections have a number of optional parameters as well.Toget the same map without using the defaults, you would use </p><pre>m_proj('oblique mercator','longitudes',[-132 -125], ...<br>       'latitudes',[56 40],'direction','vertical','aspect',.5);<br></pre>The exact meanings of the various options is given in <a href="#p2">Section 2 </a>. However, notice that longitudes are specified using a <em>signed </em> notation - East longitudes are positive, whereas Westlongitudes are negative (Also note that a decimal degree notationis used, so that a longitude of 120 30'W is specified as -120.5).<p> The second line draws a coastline, using the 1/4 degree database.Coastlines with greater resolution can be drawn, using your owndatabase (see also <a href="#p7"> Section 7 </a>). <code>m_coast</code>can be called withvarious line parameters. For example, </p><pre>m_coast('linewidth',2,'color','r');<br></pre>draws a thicker red coastline. Filled coastlines can also be drawn,using the <code> 'patch' </code> option (followed by any of the usualPATCH property/value pairs).<pre>m_coast('patch',[.7 .7 .7],'edgecolor','none');<br></pre>draws a coastline with a gray fill and no border.<p> The third line superimposes a grid. Although there are manypossible options that can be used to customize the appearance of thegrid, defaults can always be used (as in the example). These optionsare discussed in <a href="#p4"> Section 4 </a>. You can get a list ofthe options using the GET syntax: </p><pre>m_grid get<br></pre>which acts somewhat like the <code> get(gca) </code> syntax forregular plots.<p> Finally, suppose you want to show and label the location of, say, amooring at 129W, 48 30'N. </p><pre>[X,Y]=m_ll2xy(-129,48.5);<br>line(X,Y,'marker','square','markersize',4,'color','r');<br>text(X,Y,' M5','vertical','top');<br></pre><p> <code> m_ll2xy </code> (and its inverse <code>m_xy2ll</code>)convert from longitude/latitude coordinates to those of the projection.Various clipping options can also be specified in converting toprojection coordinates. If you are willing to accept default clippingsetting, you can use thebuilt-in functions <code> m_line </code> and <code> m_text </code>:</p><pre>m_line(-129,48.5,'marker','square','markersize',4,'color','r');<br>m_text(-129,48.5,' M5','vertical','top');<br></pre><p> Finally (!), we may want to alter the grid details slightly. Notethat, a given map must only be initialized once. </p><pre>clf<br>m_coast('patch',[.7 .7 .7],'edgecolor','none');<br>m_grid('xlabeldir','end','fontsize',10);<br>m_line(-129,48.5,'marker','square','markersize',4,'color','r');<br>m_text(-129,48.5,' M5','vertical','top');<br></pre><center><img src="exobl2.gif" align="middle"> </center><hr><h2> <a name="p2"> 2. Specifying projections </a> </h2><p> In order to get a list of the current projections, </p><pre>m_proj get<br></pre>or<pre>m_proj('get');<br></pre>Which currently return the following list:<pre>Available projections are:<br>     Stereographic<br>     Orthographic <br>     Azimuthal Equal-area<br>     Azimuthal Equidistant<br>     Gnomonic<br>     Satellite<br>     Albers Equal-Area Conic<br>     Lambert Conformal Conic<br>     Mercator<br>     Miller Cylindrical<br>     Equidistant Cylindrical<br>     Oblique Mercator<br>     Transverse Mercator<br>     Sinusoidal<br>     Gall-Peters<br>     Hammer-Aitoff<br>     Mollweide<br>   Robinson<br>  UTM<br></pre>If you want details about the possible options for any of theseprojections, add its name to the above command, e.g.<pre>m_proj('get','stereographic');<br>     'Stereographic'                                   <br>     &lt;,'lon&lt;gitude&gt;',center_long&gt;                      <br>     &lt;,'lat&lt;itude&gt;', center_lat&gt;                       <br>     &lt;,'rad&lt;ius&gt;', ( degrees | [longitude latitude] )&gt;<br>     &lt;,'rec&lt;tbox&gt;', ( 'on' | 'off' )&gt;                  <br></pre>You can also get details about the current projection. For example, inorder to see what the default parameters are for the sinusoidalprojection, we first initialize it, and then use the <code> 'set' </code>option:<pre>m_proj('sinusoidal');<br>m_proj set<br>Current mapping parameters -<br> Projection: Sinusoidal  (function: mp_tmerc)<br> longitudes: -90  30 (centered at -30)       <br> latitudes: -65  65                          <br> Rectangular border: off                     <br></pre>In order to initialize a projection, you usually specify some locationparameters that define the geometry of the projection (longitudinallimits, central parallel, etc.), as well as parameters that define theextentof the map (whether it is in a rectangular axis, what the border pointsare, etc.). These vary slightly from projection to projection.<p> Two useful properties for projections are (1) the ability thepreserve angles for differentially small regions, and (2) the abilityto preserve area. Projections satisfying the first condition are called<em> conformal </em>, those satisfying the second are called <em>equal-area </em>. Noprojection can be both. Many projections (especially globalprojections)are neither, instead an attempt has been made to aesthetically balancethe errors in both conditions. </p><p> Note: All projections (except UTM) are currently <em> spherical </em>rather than ellipsoidal. It is unlikely that this will be a problem innormal usage. </p><ol>  <h3><li> <a name="p2.1"> Azimuthal projections </a></li>  </h3>  <a name="p2.1">Azimuthal projections are those in which points on theglobe are projected onto a flat tangent plane. Maps using theseprojections have the property that direction or azimuth from the centerpoint to all other points is shown correctly. Great circle routespassing through the central point appear as straight lines (althoughgreat circles not passing through the central point may appear curved).These maps are usually drawn with circular boundaries. The followingparameters are needed to define an azimuthal projection: </a>  <h4><a name="p2.1"> <code> &lt;,'lon&lt;gitude&gt;',center_long&gt; <br>&lt;,'lat&lt;itude&gt;', center_lat&gt; </code> </a></h4>  <a name="p2.1"> These parameters define the center point of themap. Maps are aligned so that the specified longitude is vertical atthemap center, with its northern end at the top (but see option <code>rotangle</code>below). </a>  <h4><a name="p2.1"> <code> &lt;,'rad&lt;ius&gt;', ( degrees |[longitude latitude] )&gt; </code> </a></h4>  <a name="p2.1"> This defines the extent of the map. Either an angulardistance in degrees can be given (e.g. 90 for a hemisphere), or thecoordinates of a point on the boundary can be specified. </a>  <h4><a name="p2.1"> <code> &lt;,'rec&lt;tbox&gt;', ( 'on' | 'off'| 'circle' )&gt; </code> </a></h4>  <a name="p2.1"> The default is to enclose the mapin a circular boundary (chosen using either of the latter two options),but a rectangular one can also be specified. However, rectangular mapsareusually better drawn using a cylindrical or conic projection of somesort. </a>  <h4><a name="p2.1"> <code> &lt;,'rot&lt;angle&gt;', degrees CCW&gt; </code>  </a></h4>  <a name="p2.1"> This rotates the figure so that the central longitudeis not vertical. </a>  <ol>    <a name="p2.1"> </a>    <h4><a name="p2.1"> <li>Stereographic </li>    </a></h4>    <a name="p2.1">The stereographic projection is conformal, but notequal-area. This projection is often used for polar regions. </a>    <h4><a name="p2.1"> <li>Orthographic </li>    </a></h4>    <a name="p2.1">This projection is neither equal-area nor conformal,but resembles a perspective view of the globe. </a>    <h4><a name="p2.1"> <li>Azimuthal Equal-Area </li>    </a></h4>    <a name="p2.1">Sometimes called the Lambert azimuthal equal-areaprojection, this mapping is equal-area but not conformal. </a>    <h4><a name="p2.1"> <li>Azimuthal Equidistant </li>    </a></h4>    <a name="p2.1">This projection is neither equal-area nor conformal,but all distances and directions from the central point are true. </a>    <h4><li><a name="p2.1"> Gnomonic </a></li>    </h4>    <a name="p2.1">This projection is neither equal-area nor conformal,but all straight lines on the map (not just those through the center)are great circle routes. There is, however, a great degree ofdistortion at the edges of the map, so maximum radii should be keptfairly small - 20 or30 degrees at most. </a>    <h4><li><a name="p2.1"> Satellite </a></li>    </h4>    <a name="p2.1">This is a perspective view of the earth, as seen bya satellite at a specified altitude. Instead of specifying a <code>radius</code>for the map, the viewpoint altitude is specified: </a>    <h4><a name="p2.1"> <code> &lt;,'alt&lt;itude&gt;',altitude_fraction &gt; </code> </a></h4>    <a name="p2.1"> the numerical value assigned to this propertyrepresents the height of the viewpoint in units of earth radii. Forexample, a satellite in an orbit of radius 3 earth radii would have analtitude of2. </a>  </ol>  <a name="p2.1"> </a>  <h3><a name="p2.1"> <li><br>  </li>  </a><a name="p2.2"> Cylindrical and Pseudo-cylindrical Projections </a></h3>  <a name="p2.2">Cylindrical projections are formed by projectingpoints onto a plane wrapped around the globe, touching only along somegreatcircle. These are very useful projections for showing regions of greatlateral extent, and are also commonly used for global maps ofmid-latituderegions only. Also included here are two pseudo-cylindricalprojections,the sinusoidal and Gall-Peters, which have some similarities to thecylindricalprojections (see below). </a>  <p> <a name="p2.2">These maps are usually drawn with rectangularboundaries (with the exception of the sinusoidal and sometimes thetransverse mercator). </a></p>  <ol>    <a name="p2.2"> </a>    <h4><li><a name="p2.2"> Mercator </a></li>    </h4>    <a name="p2.2">This is a conformal map, based on a tangent cylinderwrapped around the equator. Straight lines on this projection are rhumblines (i.e. the track followed by a course of constant bearing). Thefollowing properties affect this projection: </a>    <h4><a name="p2.2"> <code> &lt;,'lon&lt;gitude&gt;',( [min max] |center)&gt; </code> </a></h4>    <a name="p2.2">Either longitude limits can be set, or a centrallongitude defined implying a global map. </a>    <h4><a name="p2.2"> <code> &lt;,'lat&lt;itude&gt;', ( maxlat |[min max])&gt; </code> </a></h4>    <a name="p2.2"> Latitude limits are most usually the same inboth N and S latitude, and can be specified with a single value, but(ifdesired) unequal limits can also be used. </a>    <h4><a name="p2.2"> <li>Miller Cylindrical </li>    </a></h4>    <a name="p2.2">This projection is neither equal-area nor conformal,but "looks nice" for world maps. Properties are the same as for theMercator, above. </a>    <h4><a name="p2.2"> <li> Equidistant cylindrical </li>    </a></h4>    <a name="p2.2">This projection is neither equal-area nor conformal.It consists of equally-spaced latitude and longitude lines, and is veryoften used for quick plotting of data. It is included here simply sothat such maps can take advantage of the grid generation routines. Alsoknown asthe Plate Carree. Properties are the same as for the Mercator, above. </a>    <h4><li><a name="p2.2"> Oblique Mercator </a></li>    </h4>    <a name="p2.2">The oblique mercator arises when the great circleof tangency is arbitrary. This is a useful projection for, e.g., long

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -