summaryrefslogtreecommitdiffstats
path: root/upstream/mageia-cauldron/man1/pnmmercator.1
blob: 3ef7c7d23755e2b2eeb8a90edd34c9024cea11a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it!  If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "PnmMercator User Manual" 0 "October 2009" "netpbm documentation"

.SH NAME
pnmmercator - transform a worldmap from rectangular projection to Mercator
projection and vice-versa

.UN synopsis
.SH SYNOPSIS
\fBpnmmercator\fP
[\fB-inverse\fP]
[\fB-nomix\fP]
[\fB-[v]verbose\fP]
[\fB\fIfilename\fP\fP]
.PP
Minimum unique abbreviation of option is acceptable. 
You may use double hyphens instead of single hyphen to denote options.

.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
The \fBpnmmercator\fP utility, converts a rectangular projection worldmap
to a Mercator projection format, as used for maps.google.com and many other
online maps.  The map used as input for \fBpnmmercator\fP must have rows for
-90 to 90 degrees latitude and columns for -180 to +180 degrees longitude. The
file will typically be twice as wide as high, but this is not a
requirement. The output file will be using the 
.UR http://en.wikipedia.org/wiki/Mercator_projection
Mercator projection
.UE
\& and will get double the height of the input file.
.PP
Maps using the Mercator projection are stretched more the closer a row is
to the North or South Pole. The last few degrees (> 85 or < -85 degrees)
are not part of a Mercator map at all because they would be stretched too much
and the rows close to the edge will show banding, because they originate from
the same row in the original map.
.PP
To overcome this, the program will by default do interpolation of pixel
colors, which will eliminate the banding effect, but will cause some blurring
of the output. With the -nomix option, this interpolation of colors isn't
applied. You can obtain the highest quality output by starting with an input
map of high resolution, so that you can follow the \fBpnmmercator\fP
transformation with a \fBpamscale\fP reduction in size.
.PP
This program can also convert a Mercator projection map back to a
rectangular projection based.  As said, the Mercator map doesn't have
information about the latitudes close to the poles.  Therefore the top rows in
the output image will be identical and copied from the row corresponding with
latitude of 85 degrees. The same at the bottom of the map.
.PP
Pnmmercator doesn't have any provision for scaling the image. You can scale
by piping the output of the program through Netpbm programs such as
\fBpamscale\fP.
.PP
You can find maps to be used as input at
.BR "flatplanet.sourceforge.net" (1)\c
\&
or 
.UR http://www.evl.uic.edu/pape/data/Earth/
uic.edu/pape
.UE
\&.
.PP
The point of a Mercator projection map is that compass directions work on
it.  If you draw a straight line northeast from some point on the Mercator
map, the line traces the course you would sail if you sailed a compass bearing
of northeast from that spot.  Naturally, primitive navigators appreciated
that.  The biggest drawback of Mercator is that areas to the north and south
appear much larger than they are in real life.  For example, Greenland appears
to be larger than South America even though it only a ninth as large.  Note
that areas away from the equator are stretched north-south as well as
east-west.
.PP
A rectangular projection is one where vertical distance is proportional to
angular latitude distance of the represented area and horizontal distance is
proportional to angular longitude.


.UN parameters
.SH PARAMETERS
.PP
\fB\fIfilename\fP\fP is the name of the input file.  If you don't specify
this, \fBpnmmercator\fP reads the image from standard Input.

.UN options
.SH OPTIONS
.PP
In addition to the options common to all programs based on libnetpbm
(most notably \fB-quiet\fP, see 
.UR index.html#commonoptions
 Common Options
.UE
\&), \fBpnmmercator\fP recognizes the following
command line options:


.TP
\fB-inverse\fP
.sp
With this option a conversion from Mercator to degrees is applied.The
output image will have half the height of the input map.

.TP
\fB-nomix\fP
.sp
Default behaviour is that color blending is applied in between two adjacent
rows. If you specify the -nomix parameter there is no blending. The
consequence is a banding at the top and bottom of the map.  With this option,
the output map will also consist of exactly the same colors as the input.

.TP
\fB-verbose\fP and \fB-vverbose\fP
.sp
This parameter outputs some additional information. If you double the 'v',
it will output debug data about the lat/long degree and Mercator
conversions.



.UN seealso
.SH SEE ALSO
.BR "pnm" (1)\c
\& and
.BR "pamscale" (1)\c
\&
.BR "ppmglobe" (1)\c
\&

.UN history
.SH HISTORY
.PP
\fBpnmmercator\fP was new in Netpbm 10.49 (December 2009).

.UN authors
.SH AUTHORS
.PP
\fIWillem van Schaik\fP (of
\fBpnmtopng\fP/\fBpngtopnm\fP fame) wrote this program in October 2009 and
suggested it for inclusion in Netpbm.
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source.  The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/pnmmercator.html
.PP