1MAPPROJECT(1)                Generic Mapping Tools               MAPPROJECT(1)
2
3
4

NAME

6       mapproject - Forward and Inverse map transformation of 2-D coordinates
7

SYNOPSIS

9       mapproject    infiles    -Jparameters    -Rwest/east/south/north[r]   [
10       -Ab|B|f|F[lon0/lat0] ] [ -C[dx/dy] ] [ -Dc|i|m|p  ]  [  -E[datum]  ]  [
11       -F[k|m|n|i|c|p]  ]  [  -G[x0/y0][+|-][/unit] ] [ -H[i][nrec] ] [ -I ] [
12       -Lline.xy[/unit][+] ] [ -Q[d|e ] [ -S ] [ -T[h]from[/to] ]  [  -V  ]  [
13       -:[i|o]  ]  [ -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [ -f[i|o]colinfo ] [
14       -g[a]x|y|d|X|Y|D|[col]z[+|-]gap[u] ] [ -m[i|o][flag] ]
15

DESCRIPTION

17       mapproject reads (longitude, latitude) positions from infiles [or stan‐
18       dard input] and computes (x,y) coordinates using the specified map pro‐
19       jection and scales.  Optionally, it can read (x,y) positions  and  com‐
20       pute  (longitude,  latitude)  values  doing the inverse transformation.
21       This can be used to transform linear (x,y) points obtained by  digitiz‐
22       ing  a  map  of known projection to geographical coordinates.  May also
23       calculate distances along track, to a fixed point, or closest  approach
24       to  a line.  Finally, can be used to perform various datum conversions.
25       Additional data fields are permitted after the first  2  columns  which
26       must  have (longitude,latitude) or (x,y).  See option -: on how to read
27       (latitude,longitude) files.
28
29       infiles
30              Data file(s) to be transformed.  If not given, standard input is
31              read.
32
33       -J     Selects  the  map projection. The following character determines
34              the projection. If the character is upper case  then  the  argu‐
35              ment(s)  supplied as scale(s) is interpreted to be the map width
36              (or axis lengths), else the scale argument(s) is the  map  scale
37              (see  its  definition for each projection). UNIT is cm, inch, or
38              m, depending on the MEASURE_UNIT setting in  .gmtdefaults4,  but
39              this can be overridden on the command line by appending c, i, or
40              m to the scale or width values.  Append h, +, or - to the  given
41              width  if you instead want to set map height, the maximum dimen‐
42              sion, or the minimum dimension, respectively [Default is  w  for
43              width].
44              In  case the central meridian is an optional parameter and it is
45              being omitted, then the center of the longitude range  given  by
46              the  -R  option  is  used.  The default standard parallel is the
47              equator.
48              The ellipsoid used in the map projections is  user-definable  by
49              editing  the  .gmtdefaults4 file in your home directory. 73 com‐
50              monly used ellipsoids and spheroids are currently supported, and
51              users  may  also  specify  their own custum ellipsoid parameters
52              [Default is WGS-84].  Several GMT parameters can affect the pro‐
53              jection:  ELLIPSOID,  INTERPOLANT,  MAP_SCALE_FACTOR,  and  MEA‐
54              SURE_UNIT; see the gmtdefaults man page for details.
55              Choose one of the following projections (The E or C  after  pro‐
56              jection  names  stands  for  Equal-Area  and  Conformal, respec‐
57              tively):
58
59              CYLINDRICAL PROJECTIONS:
60
61              -Jclon0/lat0/scale or -JClon0/lat0/width (Cassini).
62                     Give projection center lon0/lat0  and  scale  (1:xxxx  or
63                     UNIT/degree).
64
65              -Jcyl_stere/[lon0/[lat0/]]scale                               or
66              -JCyl_stere/[lon0/[lat0/]]width (Cylindrical Stereographic).
67                     Give central meridian lon0 (optional), standard  parallel
68                     lat0  (optional),  and  scale  along  parallel (1:xxxx or
69                     UNIT/degree).  The standard parallel is typically one  of
70                     these (but can be any value):
71                            66.159467 - Miller's modified Gall
72                            55 - Kamenetskiy's First
73                            45 - Gall's Stereographic
74                            30  -  Bolshoi  Sovietskii  Atlas Mira or Kamenet‐
75                            skiy's Second
76                            0 - Braun's Cylindrical
77
78              -Jj[lon0/]scale or -JJ[lon0/]width (Miller  Cylindrical  Projec‐
79              tion).
80                     Give  the  central  meridian  lon0  (optional)  and scale
81                     (1:xxxx or UNIT/degree).
82
83              -Jm[lon0/[lat0/]]scale or -JM[lon0/[lat0/]]width
84                     Give central meridian lon0 (optional), standard  parallel
85                     lat0  (optional),  and  scale  along  parallel (1:xxxx or
86                     UNIT/degree).
87
88              -Joparameters (Oblique Mercator [C]).
89                     Specify one of:
90
91                     -Jo[a]lon0/lat0/azimuth/scale                          or
92                     -JO[a]lon0/lat0/azimuth/width
93                            Set   projection   center  lon0/lat0,  azimuth  of
94                            oblique equator, and scale.
95
96                     -Jo[b]lon0/lat0/lon1/lat1/scale                        or
97                     -JO[b]lon0/lat0/lon1/lat1/scale
98                            Set  projection center lon0/lat0, another point on
99                            the oblique equator lon1/lat1, and scale.
100
101                     -Joclon0/lat0/lonp/latp/scale                          or
102                     -JOclon0/lat0/lonp/latp/scale
103                            Set  projection  center lon0/lat0, pole of oblique
104                            projection lonp/latp, and scale.
105
106                     Give scale along oblique equator (1:xxxx or UNIT/degree).
107
108              -Jq[lon0/[lat0/]]scale  or  -JQ[lon0/[lat0/]]width  (Cylindrical
109              Equidistant).
110                     Give  the central meridian lon0 (optional), standard par‐
111                     allel lat0 (optional), and scale (1:xxxx or UNIT/degree).
112                     The  standard parallel is typically one of these (but can
113                     be any value):
114                            61.7 - Grafarend and Niermann, minimum linear dis‐
115                            tortion
116                            50.5 - Ronald Miller Equirectangular
117                            43.5  - Ronald Miller, minimum continental distor‐
118                            tion
119                            42 - Grafarend and Niermann
120                            37.5 - Ronald Miller, minimum overall distortion
121                            0 - Plate Carree, Simple Cylindrical,  Plain/Plane
122                            Chart
123
124              -Jtlon0/[lat0/]scale or -JTlon0/[lat0/]width
125                     Give  the  central  meridian  lon0, central parallel lat0
126                     (optional), and scale (1:xxxx or UNIT/degree).
127
128              -Juzone/scale or -JUzone/width (UTM - Universal Transverse  Mer‐
129              cator [C]).
130                     Give  the UTM zone (A,B,1-60[C-X],Y,Z)) and scale (1:xxxx
131                     or UNIT/degree).
132                     Zones: If C-X not given, prepend - or + to enforce south‐
133                     ern or northern hemisphere conventions [northern if south
134                     > 0].
135
136              -Jy[lon0/[lat0/]]scale  or  -JY[lon0/[lat0/]]width  (Cylindrical
137              Equal-Area [E]).
138                     Give  the central meridian lon0 (optional), standard par‐
139                     allel lat0 (optional), and scale (1:xxxx or UNIT/degree).
140                     The  standard parallel is typically one of these (but can
141                     be any value):
142                            50 - Balthasart
143                            45 - Gall-Peters
144                            37.0666 - Caster
145                            37.4 - Trystan Edwards
146                            37.5 - Hobo-Dyer
147                            30 - Behrman
148                            0 - Lambert (default)
149
150              CONIC PROJECTIONS:
151
152              -Jblon0/lat0/lat1/lat2/scale   or   -JBlon0/lat0/lat1/lat2/width
153              (Albers [E]).
154                     Give  projection center lon0/lat0, two standard parallels
155                     lat1/lat2, and scale (1:xxxx or UNIT/degree).
156
157              -Jdlon0/lat0/lat1/lat2/scale   or   -JDlon0/lat0/lat1/lat2/width
158              (Conic Equidistant)
159                     Give  projection center lon0/lat0, two standard parallels
160                     lat1/lat2, and scale (1:xxxx or UNIT/degree).
161
162              -Jllon0/lat0/lat1/lat2/scale   or   -JLlon0/lat0/lat1/lat2/width
163              (Lambert [C])
164                     Give  origin lon0/lat0, two standard parallels lat1/lat2,
165                     and scale along these (1:xxxx or UNIT/degree).
166
167              -Jpoly/[lon0/[lat0/]]scale or -JPoly/[lon0/[lat0/]]width ((Amer‐
168              ican) Polyconic).
169                     Give the central meridian lon0 (optional), reference par‐
170                     allel lat0 (optional, default = equator), and scale along
171                     central meridian (1:xxxx or UNIT/degree).
172
173              AZIMUTHAL PROJECTIONS:
174
175              Except  for  polar aspects, -Rw/e/s/n will be reset to -Rg.  Use
176              -R<...>r for smaller regions.
177
178              -Jalon0/lat0[/horizon]/scale   or   -JAlon0/lat0[/horizon]/width
179              (Lambert [E]).
180                     lon0/lat0 specifies the projection center.  horizon spec‐
181                     ifies  the  max  distance  from  projection  center   (in
182                     degrees,  <=  180,  default 90).  Give scale as 1:xxxx or
183                     radius/lat, where radius is distance in UNIT from  origin
184                     to the oblique latitude lat.
185
186              -Jelon0/lat0[/horizon]/scale   or   -JElon0/lat0[/horizon]/width
187              (Azimuthal Equidistant).
188                     lon0/lat0 specifies the projection center.  horizon spec‐
189                     ifies   the  max  distance  from  projection  center  (in
190                     degrees, <= 180, default 180).  Give scale as  1:xxxx  or
191                     radius/lat,  where radius is distance in UNIT from origin
192                     to the oblique latitude lat.
193
194              -Jflon0/lat0[/horizon]/scale   or   -JFlon0/lat0[/horizon]/width
195              (Gnomonic).
196                     lon0/lat0 specifies the projection center.  horizon spec‐
197                     ifies  the  max  distance  from  projection  center   (in
198                     degrees,  <  90,  default  60).   Give scale as 1:xxxx or
199                     radius/lat, where radius is distance in UNIT from  origin
200                     to the oblique latitude lat.
201
202              -Jglon0/lat0[/horizon]/scale   or   -JGlon0/lat0[/horizon]/width
203              (Orthographic).
204                     lon0/lat0 specifies the projection center.  horizon spec‐
205                     ifies   the  max  distance  from  projection  center  (in
206                     degrees, <= 90, default 90).  Give  scale  as  1:xxxx  or
207                     radius/lat,  where radius is distance in UNIT from origin
208                     to the oblique latitude lat.
209
210              -Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale   or
211              -JGlon0/lat0/altitude/azimuth/tilt/twist/Width/Height/width
212              (General Perspective).
213                     lon0/lat0 specifies the projection center.   altitude  is
214                     the  height  (in  km)  of  the  viewpoint above local sea
215                     level.  If altitude is less than 10, then it is the  dis‐
216                     tance  from  the  center of the earth to the viewpoint in
217                     earth radii. If altitude has a suffix r then  it  is  the
218                     radius  from  the  center  of  the  earth  in kilometers.
219                     azimuth is measured to the east of north of  view.   tilt
220                     is the upward tilt of the plane of projection. If tilt is
221                     negative, then the viewpoint is centered on the  horizon.
222                     Further,  specify  the clockwise twist, Width, and Height
223                     of the viewpoint in degrees.  Give  scale  as  1:xxxx  or
224                     radius/lat,  where radius is distance in UNIT from origin
225                     to the oblique latitude lat.
226
227              -Jslon0/lat0[/horizon]/scale   or   -JSlon0/lat0[/horizon]/width
228              (General Stereographic [C]).
229                     lon0/lat0 specifies the projection center.  horizon spec‐
230                     ifies  the  max  distance  from  projection  center   (in
231                     degrees,  < 180, default 90).  Give scale as 1:xxxx (true
232                     at pole) or lat0/1:xxxx (true at standard parallel  lat0)
233                     or  radius/lat (radius in UNIT from origin to the oblique
234                     latitude lat).  Note if 1:xxxx is used  then  to  specify
235                     horizon  you  must also specify the lat0 as +-90 to avoid
236                     ambiguity.
237
238              MISCELLANEOUS PROJECTIONS:
239
240              -Jh[lon0/]scale or -JH[lon0/]width (Hammer [E]).
241                     Give the central meridian lon0 (optional) and scale along
242                     equator (1:xxxx or UNIT/degree).
243
244              -Ji[lon0/]scale or -JI[lon0/]width (Sinusoidal [E]).
245                     Give the central meridian lon0 (optional) and scale along
246                     equator (1:xxxx or UNIT/degree).
247
248              -Jkf[lon0/]scale or -JKf[lon0/]width (Eckert IV) [E]).
249                     Give the central meridian lon0 (optional) and scale along
250                     equator (1:xxxx or UNIT/degree).
251
252              -Jk[s][lon0/]scale or -JK[s][lon0/]width (Eckert VI) [E]).
253                     Give the central meridian lon0 (optional) and scale along
254                     equator (1:xxxx or UNIT/degree).
255
256              -Jn[lon0/]scale or -JN[lon0/]width (Robinson).
257                     Give the central meridian lon0 (optional) and scale along
258                     equator (1:xxxx or UNIT/degree).
259
260              -Jr[lon0/]scale -JR[lon0/]width (Winkel Tripel).
261                     Give the central meridian lon0 (optional) and scale along
262                     equator (1:xxxx or UNIT/degree).
263
264              -Jv[lon0/]scale or -JV[lon0/]width (Van der Grinten).
265                     Give the central meridian lon0 (optional) and scale along
266                     equator (1:xxxx or UNIT/degree).
267
268              -Jw[lon0/]scale or -JW[lon0/]width (Mollweide [E]).
269                     Give the central meridian lon0 (optional) and scale along
270                     equator (1:xxxx or UNIT/degree).
271
272              NON-GEOGRAPHICAL PROJECTIONS:
273
274              -Jp[a]scale[/origin][r|z]  or  -JP[a]width[/origin][r|z]  (Polar
275              coordinates (theta,r))
276                     Optionally  insert  a after -Jp [ or -JP] for azimuths CW
277                     from North instead of directions CCW from East [Default].
278                     Optionally append /origin in degrees to indicate an angu‐
279                     lar offset [0]).  Finally, append r if r is elevations in
280                     degrees (requires s >= 0 and n <= 90) or z if you want to
281                     annotate depth rather than radius [Default].  Give  scale
282                     in UNIT/r-unit.
283
284              -Jxx-scale[/y-scale]  or  -JXwidth[/height]  (Linear,  log,  and
285              power scaling)
286                     Give  x-scale  (1:xxxx  or  UNIT/x-unit)  and/or  y-scale
287                     (1:xxxx  or  UNIT/y-unit); or specify width and/or height
288                     in UNIT.  y-scale=x-scale if not specified separately and
289                     using  1:xxxx  implies  that  x-unit  and  y-unit  are in
290                     meters.  Use negative scale(s) to reverse  the  direction
291                     of an axis (e.g., to have y be positive down). Set height
292                     or width to 0 to have it recomputed based on the  implied
293                     scale  of the other axis.  Optionally, append to x-scale,
294                     y-scale, width or height one of the following:
295
296                     d      Data are geographical coordinates (in degrees).
297
298                     l      Take log10 of values before scaling.
299
300                     ppower Raise values to power before scaling.
301
302                     t      Input coordinates are time relative to TIME_EPOCH.
303
304                     T      Input coordinates are absolute time.
305
306                     Default axis lengths (see  gmtdefaults)  can  be  invoked
307                     using -JXh (for landscape); -JXv (for portrait) will swap
308                     the x- and y-axis lengths.  The  default  unit  for  this
309                     installation is either cm or inch, as defined in the file
310                     share/gmt.conf. However, you may change this  by  editing
311                     your .gmtdefaults4 file(s).
312
313       -R     xmin,  xmax, ymin, and ymax specify the Region of interest.  For
314              geographic regions,  these  limits  correspond  to  west,  east,
315              south,  and north and you may specify them in decimal degrees or
316              in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if  lower  left
317              and  upper  right  map coordinates are given instead of w/e/s/n.
318              The two shorthands -Rg and -Rd stand for  global  domain  (0/360
319              and  -180/+180  in longitude respectively, with -90/+90 in lati‐
320              tude).  Alternatively, specify the name of an existing grid file
321              and the -R settings (and grid spacing, if applicable) are copied
322              from the grid.  For calendar time  coordinates  you  may  either
323              give  (a) relative time (relative to the selected TIME_EPOCH and
324              in the selected TIME_UNIT; append t to -JX|x), or  (b)  absolute
325              time  of  the form [date]T[clock] (append T to -JX|x).  At least
326              one of date and clock must be present; the T is always required.
327              The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian
328              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
329              string  must  be  of the form hh:mm:ss[.xxx].  The use of delim‐
330              iters and their type and positions must be exactly as  indicated
331              (however,  input,  output and plot formats are customizable; see
332              gmtdefaults).  Special case for the UTM  projection:  If  -C  is
333              used and -R is not given then the region is set to coincide with
334              the given UTM zone so as to preserve the full ellipsoidal  solu‐
335              tion (See RESTRICTIONS for more information).
336

OPTIONS

338       No space between the option flag and the associated arguments.
339
340       infile(s)
341              input  file(s)  with  2 or more columns. If no file(s) is given,
342              mapproject will read the standard input.
343
344       -A[f|b]
345              -A calculates the (forward) azimuth from fixed point lon/lat  to
346              each  data  point.  Use -Ab to get back-azimuth from data points
347              to fixed point.  Upper case F or B will convert from geodetic to
348              geocentric latitudes and estimate azimuth of geodesics (assuming
349              the current ellipsoid is not a sphere).  If no  fixed  point  is
350              given  then  we  compute  the azimuth (or back-azimuth) from the
351              previous point.
352
353       -C     Set center of projected coordinates to be at map projection cen‐
354              ter  [Default is lower left corner].  Optionally, add offsets in
355              the projected units to be added (or subtracted when -I  is  set)
356              to  (from) the projected coordinates, such as false eastings and
357              northings for particular projection zones [0/0].  The unit  used
358              for  the  offsets  is the plot distance unit in effect (see MEA‐
359              SURE_UNIT) unless -F is used, in  which  case  the  offsets  are
360              always in meters.
361
362       -D     Temporarily  override  MEASURE_UNIT  and use c (cm), i (inch), m
363              (meter), or p (points) instead.  Cannot be used with -F.
364
365       -E     Convert from geodetic (lon, lat, height) to Earth Centered Earth
366              Fixed (ECEF) (x,y,z) coordinates (add -I for the inverse conver‐
367              sion).  Append datum ID (see  -Qd)  or  give  ellipsoid:dx,dy,dz
368              where  ellipsoid  may  be  an ellipsoid ID (see -Qe) or given as
369              a[,inv_f], where a is the  semi-major  axis  and  inv_f  is  the
370              inverse  flattening  (0 if omitted).  If datum is - or not given
371              we assume WGS-84.
372
373       -F     Force 1:1 scaling, i.e., output (or input, see -I) data  are  in
374              actual projected meters.  To specify other units, append k (km),
375              m (mile), n (nautical mile), i (inch), c (cm),  or  p  (points).
376              Without -F, the output (or input, see -I) are in the units spec‐
377              ified by MEASURE_UNIT (but see -D).
378
379       -G     Calculate distances along track OR to  the  optional  point  set
380              with  -Gx0/y0.  Append IT(unit), the distance unit; choose among
381              e (m), k  (km),  m  (mile),  n  (nautical  mile),  d  (spherical
382              degree),  c  (Cartesian  distance  using input coordinates) or C
383              (Cartesian distance using projected coordinates).  The last unit
384              requires -R and -J to be set.  Upper case  E, K, M, N, or D will
385              use exact methods for geodesic  distances  (Rudoe's  method  for
386              distances  in length units and employing geocentric latitudes in
387              degree calculations,  assuming  the  current  ellipsoid  is  not
388              spherical).  With no fixed point we calculate cumulate distances
389              along track. To obtain incremental distance  between  successive
390              points, use -G-.  To specify the 2nd point via two extra columns
391              in the input file, choose -G+.
392
393       -H     Input file(s) has header record(s).  If used, the default number
394              of  header records is N_HEADER_RECS.  Use -Hi if only input data
395              should have  header  records  [Default  will  write  out  header
396              records  if  the  input  data  have them]. Blank lines and lines
397              starting with # are always skipped.
398
399       -I     Do the Inverse  transformation,  i.e.  get  (longitude,latitude)
400              from (x,y) data.
401
402       -L     Determine  the  shortest  distance from the input data points to
403              the line(s) given in the ASCII multi-segment file line.xy.   The
404              distance  and  the  coordinates  of  the  nearest  point will be
405              appended to the output as three new columns.   Append  the  dis‐
406              tance  unit;  choose  among e (m), k (km), m (mile), n (nautical
407              mile), d (spherical degree), c (Cartesian distance  using  input
408              coordinates)  or  C  (Cartesian distance using projected coordi‐
409              nates).  The last unit requires -R and -J to be set.  A  spheri‐
410              cal  approximation is used for geographic data.  Finally, append
411              + to report the line segment id and the fractional point  number
412              instead of lon/lat of the nearest point.
413
414       -Q     List  all  projection parameters.  To only list datums, use -Qd.
415              To only list ellipsoids, use -Qe.
416
417       -S     Suppress points that fall outside the region.
418
419       -T     Coordinate conversions between datums  from  and  to  using  the
420              standard Molodensky transformation.  Use -Th if 3rd input column
421              has height above ellipsoid [Default assumes height = 0, i.e., on
422              the  ellipsoid].  Specify datums using the datum ID (see -Qd) or
423              give ellipsoid:dx,dy,dz where ellipsoid may be an  ellipsoid  ID
424              (see  -Qe) or given as a[,inv_f], where a is the semi-major axis
425              and inv_f is the inverse flattening (0 if omitted).  If datum is
426              -  or not given we assume WGS-84.  -T may be used in conjunction
427              with -R -J to change the datum before coordinate projection (add
428              -I  to apply the datum conversion after the inverse projection).
429              Make sure that the ELLIPSOID setting is correct for your case.
430
431       -V     Selects verbose mode, which will send progress reports to stderr
432              [Default runs "silently"].
433
434       -:     Toggles  between  (longitude,latitude)  and (latitude,longitude)
435              input and/or output.  [Default is (longitude,latitude)].  Append
436              i  to  select  input  only or o to select output only.  [Default
437              affects both].
438
439       -bi    Selects binary input.  Append s for single precision [Default is
440              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
441              Optionally, append ncol, the number of columns  in  your  binary
442              input  file if it exceeds the columns needed by the program.  Or
443              append c  if  the  input  file  is  netCDF.  Optionally,  append
444              var1/var2/...  to specify the variables to be read.  [Default is
445              2 input columns].
446
447       -bo    Selects binary output.  Append s for single  precision  [Default
448              is  d  (double)].   Uppercase  S  or D will force byte-swapping.
449              Optionally, append ncol, the number of desired columns  in  your
450              binary output file.  [Default is same as input].
451
452       -f     Special  formatting of input and/or output columns (time or geo‐
453              graphical data).  Specify i or o to  make  this  apply  only  to
454              input  or  output  [Default  applies to both].  Give one or more
455              columns (or column ranges) separated by commas.  Append T (abso‐
456              lute  calendar time), t (relative time in chosen TIME_UNIT since
457              TIME_EPOCH), x (longitude), y (latitude), or f (floating  point)
458              to  each  column or column range item.  Shorthand -f[i|o]g means
459              -f[i|o]0x,1y (geographic coordinates).
460
461       -g     Examine the spacing between consecutive data points in order  to
462              impose  breaks  in  the line.  Append x|X or y|Y to define a gap
463              when there is a large enough change in the x or  y  coordinates,
464              respectively, or d|D for distance gaps; use upper case to calcu‐
465              late gaps from projected coordinates.  For gap-testing on  other
466              columns use [col]z; if col is not prepended the it defaults to 2
467              (i.e., 3rd column).  Append [+|-]gap and optionally  a  unit  u.
468              Regarding  optional signs: -ve means previous minus current col‐
469              umn value must exceed |gap to be a gap, +ve means current  minus
470              previous  column  value  must  exceed gap, and no sign means the
471              absolute value of the difference  must  exceed  gap.   For  geo‐
472              graphic data (x|y|d), the unit u may be meter [Default], kilome‐
473              ter, miles, or nautical  miles.   For  projected  data  (X|Y|D),
474              choose from inch, centimeter, meter, or points [Default unit set
475              by MEASURE_UNIT].  Note: For x|y|z with time data  the  unit  is
476              instead  controlled  by TIME_UNIT.  Repeat the option to specify
477              multiple criteria, of which any can be met  to  produce  a  line
478              break.   Issue  an  additional -ga to indicate that all criteria
479              must be met instead.
480
481       -m     Multiple segment file(s).  Segments are separated by  a  special
482              record.   For  ASCII  files  the  first  character  must be flag
483              [Default is '>'].  For binary files all fields must be  NaN  and
484              -b must set the number of output columns explicitly.  By default
485              the -m setting applies to both input and output.   Use  -mi  and
486              -mo to give separate settings to input and output.
487

ASCII FORMAT PRECISION

489       The ASCII output formats of numerical data are controlled by parameters
490       in your .gmtdefaults4  file.   Longitude  and  latitude  are  formatted
491       according  to  OUTPUT_DEGREE_FORMAT, whereas other values are formatted
492       according to D_FORMAT.  Be aware that the format in effect can lead  to
493       loss  of  precision  in  the output, which can lead to various problems
494       downstream.  If you find the output is not written with  enough  preci‐
495       sion, consider switching to binary output (-bo if available) or specify
496       more decimals using the D_FORMAT setting.
497

EXAMPLES

499       To transform a file with (longitude,latitude) into (x,y)  positions  in
500       cm on a Mercator grid for a given scale of 0.5 cm per degree, run
501
502       mapproject lonlatfile -R20/50/12/25 -Jm0.5c > xyfile
503
504       To  transform  several  2-column,  binary,  double precision files with
505       (latitude,longitude) into (x,y) positions in inch on a Transverse  Mer‐
506       cator  grid  (central  longitude 75W) for scale = 1:500000 and suppress
507       those points that would fall outside the map area, run
508
509       mapproject tracks.* -R-80/-70/20/40 -Jt-75/1:500000 -: -S -Di -bo  -bi2
510       > tmfile.b
511
512       To  convert  the  geodetic  coordinates  (lon, lat, height) in the file
513       old.dat from the NAD27  CONUS  datum  (Datum  ID  131  which  uses  the
514       Clarke-1866 ellipsoid) to WGS 84, run
515
516       mapproject old.dat -Th131 > new.dat
517
518       To compute the closest distance (in km) between each point in the input
519       file quakes.dat and the line segments given in the multi-segment  ASCII
520       file coastline.xy, run
521
522       mapproject quakes.dat -Lcoastline.xy/k > quake_dist.dat
523

RESTRICTIONS

525       The rectangular input region set with -R will in general be mapped into
526       a non-rectangular grid.  Unless -C is set, the leftmost point  on  this
527       grid  has xvalue = 0.0, and the lowermost point will have yvalue = 0.0.
528       Thus, before you digitize  a  map,  run  the  extreme  map  coordinates
529       through mapproject using the appropriate scale and see what  (x,y) val‐
530       ues they are mapped onto.  Use these values when setting up  for  digi‐
531       tizing  in  order to have the inverse transformation work correctly, or
532       alternatively, use awk to scale  and  shift  the  (x,y)  values  before
533       transforming.
534       For  some projection, a spherical solution may be used despite the user
535       having selected an ellipsoid.  This occurs when the  users  -R  setting
536       implies  a  region  that  exceeds  the  domain in which the ellipsoidal
537       series expansions are valid.  These are  the  conditions:  (1)  Lambert
538       Conformal Conic (-JL)and Albers Equal-Area (-JB) will use the spherical
539       solution when the map scale exceeds  1.0E7.   (2)  Transverse  Mercator
540       (-JT)  and  UTM  (-JU) will will use the spherical solution when either
541       the west or east boundary given in -R is more than 10 degrees from  the
542       central  meridian,  and  (3) same for Cassini (-JC) but with a limit of
543       only 4 degrees.
544

ELLIPSOIDS AND SPHEROIDS

546       GMT will use ellipsoidal formulae if they are implemented and the  user
547       have  selected  an  ellipsoid  as the reference shape (see ELLIPSOID in
548       gmtdefaults).  The user needs to be aware of a few potential  pitfalls:
549       (1)   For  some  projections,  such as Transverse Mercator, Albers, and
550       Lamberts conformal conic we use the ellipsoidal  expressions  when  the
551       areas  mapped  are  small, and switch to the spherical expressions (and
552       substituting the appropriate auxiliary latitudes) for larger maps.  The
553       ellipsoidal formulae are used as follows: (a) Transverse Mercator: When
554       all points are within 10 degrees of central meridian, (b) Conic projec‐
555       tions when longitudinal range is less than 90 degrees, (c) Cassini pro‐
556       jection when all points are within 4 degrees of central  meridian.  (2)
557       When  you  are  trying to match some historical data (e.g., coordinates
558       obtained with a certain projection and a certain  reference  ellipsoid)
559       you  may  find that GMT gives results that are slightly different.  One
560       likely source of this mismatch is that older  calculations  often  used
561       less significant digits.  For instance, Snyder's examples often use the
562       Clarke 1866 ellipsoid (defined by  him  as  having  a  flattening  f  =
563       1/294.98).   From f we get the eccentricity squared to be 0.00676862818
564       (this is what GMT uses), while Snyder rounds off and  uses  0.00676866.
565       This  difference  can give discrepancies of several tens of cm.  If you
566       need to reproduce coordinates projected with  this  slightly  different
567       eccentricity,  you  should  specify  your  own  ellipsoid with the same
568       parameters as Clarke 1866, but with f = 1/294.97861076.  Also, be aware
569       that  older  data may be referenced to different datums, and unless you
570       know which datum was used and convert all data to a  common  datum  you
571       may  experience  mismatches of tens to hundreds of meters. (3) Finally,
572       be aware that MAP_SCALE_FACTOR have certain  default  values  for  some
573       projections  so  you may have to override the setting in order to match
574       results produced with other settings.
575

SEE ALSO

577       gmtdefaults(1), GMT(1), project(1)
578

REFERENCES

580       Bomford, G., 1952, Geodesy, Oxford U. Press.
581       Snyder, J. P., 1987, Map Projections - A Working Manual, U.S.  Geologi‐
582       cal Survey Prof. Paper 1395.
583       Vanicek,  P. and Krakiwsky, E, 1982, Geodesy - The Concepts, North-Hol‐
584       land Publ., ISBN: 0 444 86149 1.
585
586
587
588GMT 4.5.6                         10 Mar 2011                    MAPPROJECT(1)
Impressum