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|Flon0/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] ] [ -M[i|o][flag] ] [ -Q[d|e] [ -S ] [  -T[h]from[/to]
13       ]  [  -V  ]  [  -:[i|o]  ]  [  -b[i|o][s|S|d|D[ncol]|c[var1/...]]  ]  [
14       -f[i|o]colinfo ]
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. 63 com‐
50              monly used ellipsoids and a spheroid  are  currently  supported,
51              and  users  may  also  specify  their  own  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              -Jylon0/lat0/scale or -JYlon0/lat0/width (Cylindrical Equal-Area
137              [E]).
138                     Give  the  central meridian lon0, standard parallel lat0,
139                     and scale (1:xxxx or UNIT/degree).  The standard parallel
140                     is typically one of these (but can be any value):
141                            50 - Balthasart
142                            45 - Gall-Peters
143                            37.0666 - Caster
144                            37.4 - Trystan Edwards
145                            37.5 - Hobo-Dyer
146                            30 - Behrman
147                            0 - Lambert
148
149              CONIC PROJECTIONS:
150
151              -Jblon0/lat0/lat1/lat2/scale   or   -JBlon0/lat0/lat1/lat2/width
152              (Albers [E]).
153                     Give projection center lon0/lat0, two standard  parallels
154                     lat1/lat2, and scale (1:xxxx or UNIT/degree).
155
156              -Jdlon0/lat0/lat1/lat2/scale   or   -JDlon0/lat0/lat1/lat2/width
157              (Conic Equidistant)
158                     Give projection center lon0/lat0, two standard  parallels
159                     lat1/lat2, and scale (1:xxxx or UNIT/degree).
160
161              -Jllon0/lat0/lat1/lat2/scale   or   -JLlon0/lat0/lat1/lat2/width
162              (Lambert [C])
163                     Give origin lon0/lat0, two standard parallels  lat1/lat2,
164                     and scale along these (1:xxxx or UNIT/degree).
165
166              AZIMUTHAL PROJECTIONS:
167
168              Except  for  polar aspects, -Rw/e/s/n will be reset to -Rg.  Use
169              -R<...>r for smaller regions.
170
171              -Jalon0/lat0[/horizon]/scale   or   -JAlon0/lat0[/horizon]/width
172              (Lambert [E]).
173                     lon0/lat0 specifies the projection center.  horizon spec‐
174                     ifies  the  max  distance  from  projection  center   (in
175                     degrees,  <=  180,  default 90).  Give scale as 1:xxxx or
176                     radius/lat, where radius is distance in UNIT from  origin
177                     to the oblique latitude lat.
178
179              -Jelon0/lat0[/horizon]/scale   or   -JElon0/lat0[/horizon]/width
180              (Azimuthal Equidistant).
181                     lon0/lat0 specifies the projection center.  horizon spec‐
182                     ifies   the  max  distance  from  projection  center  (in
183                     degrees, <= 180, default 180).  Give scale as  1:xxxx  or
184                     radius/lat,  where radius is distance in UNIT from origin
185                     to the oblique latitude lat.
186
187              -Jflon0/lat0[/horizon]/scale   or   -JFlon0/lat0[/horizon]/width
188              (Gnomonic).
189                     lon0/lat0 specifies the projection center.  horizon spec‐
190                     ifies  the  max  distance  from  projection  center   (in
191                     degrees,  <  90,  default  60).   Give scale as 1:xxxx or
192                     radius/lat, where radius is distance in UNIT from  origin
193                     to the oblique latitude lat.
194
195              -Jglon0/lat0[/horizon]/scale   or   -JGlon0/lat0[/horizon]/width
196              (Orthographic).
197                     lon0/lat0 specifies the projection center.  horizon spec‐
198                     ifies   the  max  distance  from  projection  center  (in
199                     degrees, <= 90, default 90).  Give  scale  as  1:xxxx  or
200                     radius/lat,  where radius is distance in UNIT from origin
201                     to the oblique latitude lat.
202
203              -Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale   or
204              -JGlon0/lat0/altitude/azimuth/tilt/twist/Width/Height/width
205              (General Perspective).
206                     lon0/lat0 specifies the projection center.   altitude  is
207                     the  height  (in  km)  of  the  viewpoint above local sea
208                     level.  If altitude is less than 10, then it is the  dis‐
209                     tance  from  the  center of the earth to the viewpoint in
210                     earth radii. If altitude has a suffix r then  it  is  the
211                     radius  from  the  center  of  the  earth  in kilometers.
212                     azimuth is measured to the east of north of  view.   tilt
213                     is the upward tilt of the plane of projection. If tilt is
214                     negative, then the viewpoint is centered on the  horizon.
215                     Further,  specify  the clockwise twist, Width, and Height
216                     of the viewpoint in degrees.  Give  scale  as  1:xxxx  or
217                     radius/lat,  where radius is distance in UNIT from origin
218                     to the oblique latitude lat.
219
220              -Jslon0/lat0[/horizon]/scale   or   -JSlon0/lat0[/horizon]/width
221              (General Stereographic [C]).
222                     lon0/lat0 specifies the projection center.  horizon spec‐
223                     ifies  the  max  distance  from  projection  center   (in
224                     degrees,  < 180, default 90).  Give scale as 1:xxxx (true
225                     at pole) or lat0/1:xxxx (true at standard parallel  lat0)
226                     or  radius/lat (radius in UNIT from origin to the oblique
227                     latitude lat).
228
229              MISCELLANEOUS PROJECTIONS:
230
231              -Jh[lon0/]scale or -JH[lon0/]width (Hammer [E]).
232                     Give the central meridian lon0 (optional) and scale along
233                     equator (1:xxxx or UNIT/degree).
234
235              -Ji[lon0/]scale or -JI[lon0/]width (Sinusoidal [E]).
236                     Give the central meridian lon0 (optional) and scale along
237                     equator (1:xxxx or UNIT/degree).
238
239              -Jkf[lon0/]scale or -JKf[lon0/]width (Eckert IV) [E]).
240                     Give the central meridian lon0 (optional) and scale along
241                     equator (1:xxxx or UNIT/degree).
242
243              -Jk[s][lon0/]scale or -JK[s][lon0/]width (Eckert VI) [E]).
244                     Give the central meridian lon0 (optional) and scale along
245                     equator (1:xxxx or UNIT/degree).
246
247              -Jn[lon0/]scale or -JN[lon0/]width (Robinson).
248                     Give the central meridian lon0 (optional) and scale along
249                     equator (1:xxxx or UNIT/degree).
250
251              -Jr[lon0/]scale -JR[lon0/]width (Winkel Tripel).
252                     Give the central meridian lon0 (optional) and scale along
253                     equator (1:xxxx or UNIT/degree).
254
255              -Jv[lon0/]scale or -JV[lon0/]width (Van der Grinten).
256                     Give the central meridian lon0 (optional) and scale along
257                     equator (1:xxxx or UNIT/degree).
258
259              -Jw[lon0/]scale or -JW[lon0/]width (Mollweide [E]).
260                     Give the central meridian lon0 (optional) and scale along
261                     equator (1:xxxx or UNIT/degree).
262
263              NON-GEOGRAPHICAL PROJECTIONS:
264
265              -Jp[a]scale[/origin][r|z]  or  -JP[a]width[/origin][r|z]  (Polar
266              coordinates (theta,r))
267                     Optionally  insert  a after -Jp [ or -JP] for azimuths CW
268                     from North instead of directions CCW from East [Default].
269                     Optionally append /origin in degrees to indicate an angu‐
270                     lar offset [0]).  Finally, append r if r is elevations in
271                     degrees (requires s >= 0 and n <= 90) or z if you want to
272                     annotate depth rather than radius [Default].  Give  scale
273                     in UNIT/r-unit.
274
275              -Jxx-scale[/y-scale]  or  -JXwidth[/height]  (Linear,  log,  and
276              power scaling)
277                     Give  x-scale  (1:xxxx  or  UNIT/x-unit)  and/or  y-scale
278                     (1:xxxx  or  UNIT/y-unit); or specify width and/or height
279                     in UNIT.  y-scale=x-scale if not specified separately and
280                     using  1:xxxx  implies  that  x-unit  and  y-unit  are in
281                     meters.  Use negative scale(s) to reverse  the  direction
282                     of  an  axis (e.g., to have y be positive down).  Option‐
283                     ally, append to x-scale, y-scale, width or height one  of
284                     the following:
285
286                     d      Data are geographical coordinates (in degrees).
287
288                     l      Take log10 of values before scaling.
289
290                     ppower Raise values to power before scaling.
291
292                     t      Input coordinates are time relative to TIME_EPOCH.
293
294                     T      Input coordinates are absolute time.
295
296                     Default  axis  lengths  (see  gmtdefaults) can be invoked
297                     using -JXh (for landscape); -JXv (for portrait) will swap
298                     the  x-  and  y-axis  lengths.  The default unit for this
299                     installation is either cm or inch, as defined in the file
300                     share/gmt.conf.  However,  you may change this by editing
301                     your .gmtdefaults4 file(s).
302
303       -R     xmin, xmax, ymin, and ymax specify the Region of interest.   For
304              geographic  regions,  these  limits  correspond  to  west, east,
305              south, and north and you may specify them in decimal degrees  or
306              in  [+-]dd:mm[:ss.xxx][W|E|S|N]  format.  Append r if lower left
307              and upper right map coordinates are given  instead  of  w/e/s/n.
308              The  two  shorthands  -Rg and -Rd stand for global domain (0/360
309              and -180/+180 in longitude respectively, with -90/+90  in  lati‐
310              tude).   For  calendar  time coordinates you may either give (a)
311              relative time (relative to the selected TIME_EPOCH  and  in  the
312              selected  TIME_UNIT; append t to -JX|x), or (b) absolute time of
313              the form [date]T[clock] (append T to -JX|x).  At  least  one  of
314              date  and  clock must be present; the T is always required.  The
315              date string must be of  the  form  [-]yyyy[-mm[-dd]]  (Gregorian
316              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
317              string must be of the form hh:mm:ss[.xxx].  The  use  of  delim‐
318              iters  and their type and positions must be exactly as indicated
319              (however, input, output and plot formats are  customizable;  see
320              gmtdefaults).   Special  case  for  the UTM projection: If -C is
321              used and -R is not given then the region is set to coincide with
322              the  given UTM zone so as to preserve the full ellipsoidal solu‐
323              tion (See RESTRICTIONS for more information).
324

OPTIONS

326       No space between the option flag and the associated arguments.
327
328       infile(s)
329              input file(s) with 2 or more columns. If no  file(s)  is  given,
330              mapproject will read the standard input.
331
332       -A[f|b]
333              -A  calculates the (forward) azimuth from fixed point lon/lat to
334              each data point.  Use -Ab to get back-azimuth from  data  points
335              to fixed point.  Upper case F or B will convert from geodetic to
336              geocentric latitudes and estimate azimuth of geodesics (assuming
337              the current ellipsoid is not a sphere).
338
339       -C     Set center of projected coordinates to be at map projection cen‐
340              ter [Default is lower left corner].  Optionally, add offsets  in
341              the  projected  units to be added (or subtracted when -I is set)
342              to (from) the projected coordinates, such as false eastings  and
343              northings  for particular projection zones [0/0].  The unit used
344              for the offsets is the plot distance unit in  effect  (see  MEA‐
345              SURE_UNIT)  unless  -F is used, in which case the offsets are in
346              meters.
347
348       -D     Temporarily override MEASURE_UNIT and use c (cm),  i  (inch),  m
349              (meter), or p (points) instead.  Cannot be used with -F.
350
351       -E     Convert from geodetic (lon, lat, height) to Earth Centered Earth
352              Fixed (ECEF) (x,y,z) coordinates (add -I for the inverse conver‐
353              sion).   Append  datum  ID  (see -Qd) or give ellipsoid:dx,dy,dz
354              where ellipsoid may be an ellipsoid ID (see  -Qe)  or  given  as
355              a,1/f.  If datum is - or not given we assume WGS-84.
356
357       -F     Force  1:1  scaling, i.e., output (or input, see -I) data are in
358              actual projected meters.  To specify other units, append k (km),
359              m  (mile),  n  (nautical mile), i (inch), c (cm), or p (points).
360              Without -F, the output (or input, see -I) are in the units spec‐
361              ified by MEASURE_UNIT (but see -D).
362
363       -G     Calculate  distances  along  track  OR to the optional point set
364              with -Gx0/y0.  Append the distance unit; choose among e  (m),  k
365              (km),  m  (mile),  n  (nautical  mile),  d (spherical degree), c
366              (Cartesian distance using input  coordinates)  or  C  (Cartesian
367              distance  using  projected coordinates).  The last unit requires
368              -R and -J to be set.  Upper case  E, K, M,  N,  or  D  will  use
369              exact  methods  for  geodesic distances (Rudoe's method for dis‐
370              tances in length units and  employing  geocentric  latitudes  in
371              degree  calculations,  assuming  the  current ellipsoid is not a
372              sphere).  With no fixed point we  calculate  cumulate  distances
373              along  track.  To obtain incremental distance between successive
374              points, use -G-.  To specify the 2nd point via two extra columns
375              in the input file, choose -G+.
376
377       -H     Input  file(s)  has  Header record(s).  Number of header records
378              can be changed by editing your .gmtdefaults4 file.  If used, GMT
379              default  is  1  header record. Use -Hi if only input data should
380              have header records [Default will write out  header  records  if
381              the input data have them]. Blank lines and lines starting with #
382              are always skipped.
383
384       -I     Do the Inverse  transformation,  i.e.  get  (longitude,latitude)
385              from (x,y) data.
386
387       -L     Determine  the  shortest  distance from the input data points to
388              the line(s) given in the ASCII multi-segment file line.xy.   The
389              distance  and  the  coordinates  of  the  nearest  point will be
390              appended to the output as three new columns.   Append  the  dis‐
391              tance  unit;  choose  among e (m), k (km), m (mile), n (nautical
392              mile), d (spherical degree), c (Cartesian distance  using  input
393              coordinates)  or  C  (Cartesian distance using projected coordi‐
394              nates).  The last unit requires -R and -J to be set.  A  spheri‐
395              cal approximation is used for geographic data.
396
397       -M     Multiple  segment  file(s).  Segments are separated by a special
398              record.  For ASCII  files  the  first  character  must  be  flag
399              [Default  is  '>'].  For binary files all fields must be NaN and
400              -b must set the number of output columns explicitly.  By default
401              the  -M  setting  applies to both input and output.  Use -Mi and
402              -Mo to give separate settings.
403
404       -Q     List all projection parameters.  To only list datums,  use  -Qd.
405              To only list ellipsoids, use -Qe.
406
407       -S     Suppress points that fall outside the region.
408
409       -T     Coordinate  conversions  between  datums  from  and to using the
410              standard Molodensky transformation.  Use -Th if 3rd input column
411              has height above ellipsoid [Default assumes height = 0, i.e., on
412              the ellipsoid].  Specify datums using the ID (see -Qd)  or  give
413              ellipsoid:dx,dy,dz,  where ellipsoid may be an ellipsoid ID (see
414              -Qe) or given as a,1/f.  If datum is  -  or  not  given  we  use
415              WGS-84.   -T may be used in conjunction with -R -J to change the
416              datum before coordinate projection (add -I to  apply  the  datum
417              conversion  after  the  inverse projection).  Make sure that the
418              ELLIPSOID setting is correct for your case.
419
420       -V     Selects verbose mode, which will send progress reports to stderr
421              [Default runs "silently"].
422
423       -:     Toggles  between  (longitude,latitude)  and (latitude,longitude)
424              input and/or output.  [Default is (longitude,latitude)].  Append
425              i  to  select  input  only or o to select output only.  [Default
426              affects both].
427
428       -bi    Selects binary input.  Append s for single precision [Default is
429              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
430              Optionally, append ncol, the number of columns  in  your  binary
431              input  file if it exceeds the columns needed by the program.  Or
432              append c  if  the  input  file  is  netCDF.  Optionally,  append
433              var1/var2/...  to specify the variables to be read.  [Default is
434              2 input columns].
435
436       -bo    Selects binary output.  Append s for single  precision  [Default
437              is  d  (double)].   Uppercase  S  or D will force byte-swapping.
438              Optionally, append ncol, the number of desired columns  in  your
439              binary output file.  [Default is same as input].
440
441       -f     Special  formatting of input and/or output columns (time or geo‐
442              graphical data).  Specify i or o to  make  this  apply  only  to
443              input  or  output  [Default  applies to both].  Give one or more
444              columns (or column ranges) separated by commas.  Append T (abso‐
445              lute  calendar time), t (relative time in chosen TIME_UNIT since
446              TIME_EPOCH), x (longitude), y (latitude), or f (floating  point)
447              to  each  column or column range item.  Shorthand -f[i|o]g means
448              -f[i|o]0x,1y (geographic coordinates).
449

ASCII FORMAT PRECISION

451       The ASCII output formats of numerical data are controlled by parameters
452       in  your  .gmtdefaults4  file.   Longitude  and  latitude are formatted
453       according to OUTPUT_DEGREE_FORMAT, whereas other values  are  formatted
454       according  to D_FORMAT.  Be aware that the format in effect can lead to
455       loss of precision in the output, which can  lead  to  various  problems
456       downstream.   If  you find the output is not written with enough preci‐
457       sion, consider switching to binary output (-bo if available) or specify
458       more decimals using the D_FORMAT setting.
459

EXAMPLES

461       To  transform  a file with (longitude,latitude) into (x,y) positions in
462       cm on a Mercator grid for a given scale of 0.5 cm per degree, run
463
464       mapproject lonlatfile -R20/50/12/25 -Jm0.5c > xyfile
465
466       To transform several 2-column,  binary,  double  precision  files  with
467       (latitude,longitude)  into (x,y) positions in inch on a Transverse Mer‐
468       cator grid (central longitude 75W) for scale =  1:500000  and  suppress
469       those points that would fall outside the map area, run
470
471       mapproject  tracks.* -R-80/-70/20/40 -Jt-75/1:500000 -: -S -Di -bo -bi2
472       > tmfile.b
473
474       To convert the geodetic coordinates (lon,  lat,  height)  in  the  file
475       old.dat  from  the  NAD27  CONUS  datum  (Datum  ID  131 which uses the
476       Clarke-1866 ellipsoid) to WGS 84, run
477
478       mapproject old.dat -Th131 > new.dat
479
480       To compute the closest distance (in km) between each point in the input
481       file  quakes.dat and the line segments given in the multi-segment ASCII
482       file coastline.xy, run
483
484       mapproject quakes.dat -Lcoastline.xy/k > quake_dist.dat
485

RESTRICTIONS

487       The rectangular input region set with -R will in general be mapped into
488       a  non-rectangular  grid.  Unless -C is set, the leftmost point on this
489       grid has xvalue = 0.0, and the lowermost point will have yvalue =  0.0.
490       Thus,  before  you  digitize  a  map,  run  the extreme map coordinates
491       through mapproject using the appropriate scale and see what  (x,y) val‐
492       ues  they  are mapped onto.  Use these values when setting up for digi‐
493       tizing in order to have the inverse transformation work  correctly,  or
494       alternatively,  use  awk  to  scale  and  shift the (x,y) values before
495       transforming.
496       FOr some projection, a spherical solution may be used despite the  user
497       having  selected  an  ellipsoid.  This occurs when the users -R setting
498       implies a region that exceeds  the  domain  in  which  the  ellipsoidal
499       series  expansions  are  valid.   These are the conditions: (1) Lambert
500       Conformal Conic (-JL)and Albers Equal-Area (-JB) will use the spherical
501       solution  when  the  map  scale exceeds 1.0E7.  (2) Transverse Mercator
502       (-JT) and UTM (-JU) will will use the spherical  solution  when  either
503       the  west or east boundary given in -R is more than 10 degrees from the
504       central meridian, and (3) same for Cassini (-JC) but with  a  limit  of
505       only 4 degrees.
506

ELLIPSOIDS AND SPHEROIDS

508       GMT  will use ellipsoidal formulae if they are implemented and the user
509       have selected an ellipsoid as the reference  shape  (see  ELLIPSOID  in
510       gmtdefaults).   The user needs to be aware of a few potential pitfalls:
511       (1)  For some projections, such as  Transverse  Mercator,  Albers,  and
512       Lamberts  conformal  conic  we use the ellipsoidal expressions when the
513       areas mapped are small, and switch to the  spherical  expressions  (and
514       substituting the appropriate auxiliary latitudes) for larger maps.  The
515       ellipsoidal formulae are used as follows: (a) Transverse Mercator: When
516       all points are within 10 degrees of central meridian, (b) Conic projec‐
517       tions when longitudinal range is less than 90 degrees, (c) Cassini pro‐
518       jection  when  all points are within 4 degrees of central meridian. (2)
519       When you are trying to match some historical  data  (e.g.,  coordinates
520       obtained  with  a certain projection and a certain reference ellipsoid)
521       you may find that GMT gives results that are slightly  different.   One
522       likely  source  of  this mismatch is that older calculations often used
523       less significant digits.  For instance, Snyder's examples often use the
524       Clarke  1866  ellipsoid  (defined  by  him  as  having a flattening f =
525       1/294.98).  From f we get the eccentricity squared to be  0.00676862818
526       (this  is  what GMT uses), while Snyder rounds off and uses 0.00676866.
527       This difference can give discrepancies of several tens of cm.   If  you
528       need  to  reproduce  coordinates projected with this slightly different
529       eccentricity, you should specify  your  own  ellipsoid  with  the  same
530       parameters as Clarke 1866, but with f = 1/294.97861076.  Also, be aware
531       that older data may be referenced to different datums, and  unless  you
532       know  which  datum  was used and convert all data to a common datum you
533       may experience mismatches of tens to hundreds of meters.  (3)  Finally,
534       be  aware  that  MAP_SCALE_FACTOR  have certain default values for some
535       projections so you may have to override the setting in order  to  match
536       results produced with other settings.
537

SEE ALSO

539       gmtdefaults(1), GMT(1), project(1)
540

REFERENCES

542       Bomford, G., 1952, Geodesy, Oxford U. Press.
543       Snyder,  J. P., 1987, Map Projections - A Working Manual, U.S. Geologi‐
544       cal Survey Prof. Paper 1395.
545       Vanicek, P. and Krakiwsky, E, 1982, Geodesy - The Concepts,  North-Hol‐
546       land Publ., ISBN: 0 444 86149 1.
547
548
549
550GMT 4.3.1                         15 May 2008                    MAPPROJECT(1)
Impressum