| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 |
<html><head><title>PnmMercator User Manual</title></head> |
| 3 |
<body> |
| 4 |
<h1>pnmmercator</h1> |
| 5 |
Updated: October 2009 |
| 6 |
<br> |
| 7 |
<a href="#index">Table Of Contents</a> |
| 8 |
|
| 9 |
<h2>NAME</h2> |
| 10 |
pnmmercator - transform a worldmap from rectangular projection to Mercator |
| 11 |
projection and vice-versa |
| 12 |
|
| 13 |
<h2 id="synopsis">SYNOPSIS</h2> |
| 14 |
<b>pnmmercator</b> |
| 15 |
[<b>-inverse</b>] |
| 16 |
[<b>-nomix</b>] |
| 17 |
[<b>-[v]verbose</b>] |
| 18 |
[<b><i>filename</i></b>] |
| 19 |
|
| 20 |
<p>Minimum unique abbreviation of option is acceptable. |
| 21 |
You may use double hyphens instead of single hyphen to denote options. |
| 22 |
|
| 23 |
<h2 id="description">DESCRIPTION</h2> |
| 24 |
|
| 25 |
<p>This program is part of <a href="index.html">Netpbm</a>. |
| 26 |
|
| 27 |
<p>The <b>pnmmercator</b> utility, converts a rectangular projection worldmap |
| 28 |
to a Mercator projection format, as used for maps.google.com and many other |
| 29 |
online maps. The map used as input for <b>pnmmercator</b> must have rows for |
| 30 |
-90 to 90 degrees latitude and columns for -180 to +180 degrees longitude. The |
| 31 |
file will typically be twice as wide as high, but this is not a |
| 32 |
requirement. The output file will be using the <a |
| 33 |
href="http://en.wikipedia.org/wiki/Mercator_projection">Mercator |
| 34 |
projection</a> and will get double the height of the input file. |
| 35 |
|
| 36 |
<p>Maps using the Mercator projection are stretched more the closer a row is |
| 37 |
to the North or South Pole. The last few degrees (> 85 or < -85 degrees) |
| 38 |
are not part of a Mercator map at all because they would be stretched too much |
| 39 |
and the rows close to the edge will show banding, because they originate from |
| 40 |
the same row in the original map. |
| 41 |
|
| 42 |
<p>To overcome this, the program will by default do interpolation of pixel |
| 43 |
colors, which will eliminate the banding effect, but will cause some blurring |
| 44 |
of the output. With the -nomix option, this interpolation of colors isn't |
| 45 |
applied. You can obtain the highest quality output by starting with an input |
| 46 |
map of high resolution, so that you can follow the <b>pnmmercator</b> |
| 47 |
transformation with a <b>pamscale</b> reduction in size. |
| 48 |
|
| 49 |
<p>This program can also convert a Mercator projection map back to a |
| 50 |
rectangular projection based. As said, the Mercator map doesn't have |
| 51 |
information about the latitudes close to the poles. Therefore the top rows in |
| 52 |
the output image will be identical and copied from the row corresponding with |
| 53 |
latitude of 85 degrees. The same at the bottom of the map. |
| 54 |
|
| 55 |
<p>Pnmmercator doesn't have any provision for scaling the image. You can scale |
| 56 |
by piping the output of the program through Netpbm programs such as |
| 57 |
<b>pamscale</b>. |
| 58 |
|
| 59 |
<p>You can find maps to be used as input at <a |
| 60 |
href="http://flatplanet.sourceforge.net/maps/natural.html">flatplanet.sourceforge.net</a> |
| 61 |
or <a href="http://www.evl.uic.edu/pape/data/Earth/">uic.edu/pape</a>. |
| 62 |
|
| 63 |
<p>The point of a Mercator projection map is that compass directions work on |
| 64 |
it. If you draw a straight line northeast from some point on the Mercator |
| 65 |
map, the line traces the course you would sail if you sailed a compass bearing |
| 66 |
of northeast from that spot. Naturally, primitive navigators appreciated |
| 67 |
that. The biggest drawback of Mercator is that areas to the north and south |
| 68 |
appear much larger than they are in real life. For example, Greenland appears |
| 69 |
to be larger than South America even though it only a ninth as large. Note |
| 70 |
that areas away from the equator are stretched north-south as well as |
| 71 |
east-west. |
| 72 |
|
| 73 |
<p>A rectangular projection is one where vertical distance is proportional to |
| 74 |
angular latitude distance of the represented area and horizontal distance is |
| 75 |
proportional to angular longitude. |
| 76 |
|
| 77 |
|
| 78 |
<h2 id="parameters">PARAMETERS</h2> |
| 79 |
|
| 80 |
<p><b><i>filename</i></b> is the name of the input file. If you don't specify |
| 81 |
this, <b>pnmmercator</b> reads the image from standard Input. |
| 82 |
|
| 83 |
<h2 id="options">OPTIONS</h2> |
| 84 |
|
| 85 |
<p>In addition to the options common to all programs based on libnetpbm |
| 86 |
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> |
| 87 |
Common Options</a>), <b>pnmmercator</b> recognizes the following |
| 88 |
command line options: |
| 89 |
|
| 90 |
<dl compact> |
| 91 |
<dt><b>-inverse</b></dt> |
| 92 |
<dd> |
| 93 |
<p>With this option a conversion from Mercator to degrees is applied.The |
| 94 |
output image will have half the height of the input map. |
| 95 |
</dd> |
| 96 |
<dt><b>-nomix</b></dt> |
| 97 |
<dd> |
| 98 |
<p>Default behaviour is that color blending is applied in between two adjacent |
| 99 |
rows. If you specify the -nomix parameter there is no blending. The |
| 100 |
consequence is a banding at the top and bottom of the map. With this option, |
| 101 |
the output map will also consist of exactly the same colors as the input. |
| 102 |
</dd> |
| 103 |
<dt><b>-verbose</b> and <b>-vverbose</b></dt> |
| 104 |
<dd> |
| 105 |
<p>This parameter outputs some additional information. If you double the 'v', |
| 106 |
it will output debug data about the lat/long degree and Mercator |
| 107 |
conversions. |
| 108 |
</dd> |
| 109 |
</dl> |
| 110 |
|
| 111 |
<h2 id="seealso">SEE ALSO</h2> |
| 112 |
<b><a href="pnm.html">pnm</a></b> and |
| 113 |
<b><a href="pamscale.html">pamscale</a></b> |
| 114 |
<b><a href="ppmglobe.html">ppmglobe</a></b> |
| 115 |
|
| 116 |
<h2 id="history">HISTORY</h2> |
| 117 |
<p><b>pnmmercator</b> was new in Netpbm 10.49 (December 2009). |
| 118 |
|
| 119 |
<h2 id="authors">AUTHORS</h2> |
| 120 |
|
| 121 |
<p><a href="mailto:[email protected]">Willem van Schaik</a> (of |
| 122 |
<b>pnmtopng</b>/<b>pngtopnm</b> fame) wrote this program in October 2009 and |
| 123 |
suggested it for inclusion in Netpbm. |
| 124 |
|
| 125 |
<hr> |
| 126 |
|
| 127 |
<h2 id="index">Table Of Contents</h2> |
| 128 |
<ul> |
| 129 |
<li><a href="#synopsis">SYNOPSIS</a> |
| 130 |
<li><a href="#description">DESCRIPTION</a> |
| 131 |
<li><a href="#parameters">PARAMETERS</a> |
| 132 |
<li><a href="#options">OPTIONS</a> |
| 133 |
<li><a href="#seealso">SEE ALSO</a> |
| 134 |
<li><a href="#history">HISTORY</a> |
| 135 |
<li><a href="#authors">AUTHORS</a> |
| 136 |
</ul> |
| 137 |
</body> |
| 138 |
</html> |
| 139 |
|