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