1PROJECT(1)                            GMT                           PROJECT(1)
2
3
4

NAME

6       project  -  Project  table  data  onto lines or great circles, generate
7       tracks, or translate coordinates
8

SYNOPSIS

10       project [ table ]  -Ccx/cy [  -Aazimuth ] [  -Ebx/by ] [  -Fflags  ]  [
11       -Gdist[/colat][+h]  ] [  -L[w][l_min/l_max] ] [  -N ] [  -Q ] [  -S ] [
12       -Tpx/py ] [  -V[level] ] [  -Ww_min/w_max ] [ -bbinary ] [ -dnodata ] [
13       -eregexp ] [ -fflags ] [ -ggaps ] [ -hheaders ] [ -iflags ] [ -sflags ]
14       [ -:[i|o] ]
15
16       Note: No space is allowed between the option flag  and  the  associated
17       arguments.
18

DESCRIPTION

20       project reads arbitrary (x, y[,z]) data from standard input [or table ]
21       and writes to standard output any combination of (x, y, z, p, q, r, s),
22       where (p, q) are the coordinates in the projection, (r, s) is the posi‐
23       tion in the (x, y) coordinate system of the point on the profile (q = 0
24       path)  closest  to  (x, y), and z is all remaining columns in the input
25       (beyond the required x and y columns).
26
27       Alternatively, project may be used to generate (r,  s,  p)  triples  at
28       equal  increments  dist  along a profile. In this case ( -G option), no
29       input is read.
30
31       Projections are defined in any (but only) one of three ways:
32
33       (Definition 1) By a Center -C and an Azimuth -A  in  degrees  clockwise
34       from North.
35
36       (Definition  2)  By  a Center -C and end point E of the projection path
37       -E.
38
39       (Definition 3) By a Center -C and a roTation pole position -T.
40
41       To spherically project data along a great circle path, an oblique coor‐
42       dinate system is created which has its equator along that path, and the
43       zero meridian through the Center. Then the oblique longitude (p) corre‐
44       sponds  to the distance from the Center along the great circle, and the
45       oblique latitude (q) corresponds to the distance perpendicular  to  the
46       great circle path. When moving in the increasing (p) direction, (toward
47       B or in the azimuth direction), the positive (q) direction is  to  your
48       left.  If a Pole has been specified, then the positive (q) direction is
49       toward the pole.
50
51       To specify an oblique projection, use the -T option to  set  the  Pole.
52       Then  the  equator  of  the projection is already determined and the -C
53       option is used to locate the p = 0 meridian. The Center cx/cy  will  be
54       taken as a point through which the p = 0 meridian passes. If you do not
55       care to choose a particular point, use the South pole (ox  =  0,  oy  =
56       -90).
57
58       Data can be selectively windowed by using the -L and -W options.  If -W
59       is used, the projection Width is set to use only points with w_min <  q
60       <  w_max. If -L is set, then the Length is set to use only those points
61       with l_min < p < l_max. If the -E option has been used  to  define  the
62       projection,  then  -Lw may be selected to window the length of the pro‐
63       jection to exactly the span from O to B.
64
65       Flat Earth (Cartesian) coordinate transformations can also be made. Set
66       -N  and remember that azimuth is clockwise from North (the y axis), NOT
67       the usual cartesian theta, which is counterclockwise from the  x  axis.
68       azimuth = 90 - theta.
69
70       No assumptions are made regarding the units for x, y, r, s, p, q, dist,
71       l_min, l_max, w_min, w_max. If -Q is selected, map  units  are  assumed
72       and  x, y, r, s must be in degrees and p, q, dist, l_min, l_max, w_min,
73       w_max will be in km.
74
75       Calculations of specific great-circle and  geodesic  distances  or  for
76       back-azimuths or azimuths are better done using mapproject.
77
78       project  is  CASE SENSITIVE. Use UPPER CASE for all one-letter designa‐
79       tors which begin optional arguments. Use lower  case  for  the  xyzpqrs
80       letters in -flags.
81

REQUIRED ARGUMENTS

83       -Ccx/cy
84              cx/cy  sets  the origin of the projection, in Definition 1 or 2.
85              If Definition 3 is used (-T), then cx/cy are the coordinates  of
86              a  point  through which the oblique zero meridian (p = 0) should
87              pass.  The cx/cy is not required to be 90 degrees from the pole.
88

OPTIONAL ARGUMENTS

90       table  One or more ASCII (or binary, see -bi[ncols][type])  data  table
91              file(s) holding a number of data columns. If no tables are given
92              then we read from standard input.
93
94       -Aazimuth
95              azimuth defines the azimuth of the projection (Definition 1).
96
97       -Ebx/by
98              bx/by defines the end point of the projection  path  (Definition
99              2).
100
101       -Fflags
102              Specify your desired output using any combination of xyzpqrs, in
103              any order. Do not space between the letters. Use lower case. The
104              output will be ASCII (or binary, see -bo) columns of values cor‐
105              responding to xyzpqrs [Default]. If both input  and  output  are
106              using ASCII format then the z data are treated as textstring(s).
107              If the -G option is selected, the output will be rsp.
108
109       -Gdist[/colat][+h]
110              Generate mode. No input is read. Create (r, s, p) output  points
111              every  dist  units  of  p.  See -Q option. Alternatively, append
112              /colat for a small circle instead [Default is  a  colatitude  of
113              90,  i.e.,  a  great circle]. Use -C and -E to generate a circle
114              that goes through the center and end point. Note, in  this  case
115              the center and end point cannot be farther apart than 2*|colat|.
116              Finally, if you append +h the we will report the position of the
117              pole as part of the segment header [no header].
118
119       -L[w][l_min/l_max]
120              Length controls. Project only those points whose p coordinate is
121              within l_min < p < l_max. If -E has been set, then you  may  use
122              -Lw to stay within the distance from C to E.
123
124       -N     Flat  Earth.  Make  a Cartesian coordinate transformation in the
125              plane.  [Default uses spherical trigonometry.]
126
127       -Q     Map type units, i.e., project assumes x, y, r, s are in  degrees
128              while p, q, dist, l_min, l_max, w_min, w_max are in km. If -Q is
129              not set, then all these are assumed to be in the same units.
130
131       -S     Sort the output into increasing p order. Useful when  projecting
132              random data into a sequential profile.
133
134       -Tpx/py
135              px/py  sets the position of the rotation pole of the projection.
136              (Definition 3).
137
138       -V[level] (more ...)
139              Select verbosity level [c].
140
141       -Ww_min/w_max
142              Width controls. Project only those points whose q coordinate  is
143              within w_min < q < w_max.
144
145       -bi[ncols][t] (more ...)
146              Select native binary input. [Default is 2 input columns].
147
148       -bo[ncols][type] (more ...)
149              Select native binary output. [Default is given by -F or -G].
150
151       -d[i|o]nodata (more ...)
152              Replace  input  columns  that  equal  nodata with NaN and do the
153              reverse on output.
154
155       -e[~]"pattern" | -e[~]/regexp/[i] (more ...)
156              Only accept data records that match the given pattern.
157
158       -f[i|o]colinfo (more ...)
159              Specify data types of input and/or output columns.
160
161       -g[a]x|y|d|X|Y|D|[col]z[+|-]gap[u] (more ...)
162              Determine data gaps and line breaks.
163
164       -h[i|o][n][+c][+d][+rremark][+rtitle] (more ...)
165              Skip or produce header record(s).
166
167       -icols[+l][+sscale][+ooffset][,...] (more ...)
168              Select input columns and transformations (0 is first column).
169
170       -s[cols][a|r] (more ...)
171              Set handling of NaN records.
172
173       -:[i|o] (more ...)
174              Swap 1st and 2nd column on input and/or output.
175
176       -^ or just -
177              Print a short message about the  syntax  of  the  command,  then
178              exits (NOTE: on Windows just use -).
179
180       -+ or just +
181              Print  an extensive usage (help) message, including the explana‐
182              tion of any module-specific  option  (but  not  the  GMT  common
183              options), then exits.
184
185       -? or no arguments
186              Print a complete usage (help) message, including the explanation
187              of all options, then exits.
188

ASCII FORMAT PRECISION

190       The ASCII output formats of numerical data are controlled by parameters
191       in  your  gmt.conf file. Longitude and latitude are formatted according
192       to  FORMAT_GEO_OUT,  absolute  time  is  under  the  control  of   FOR‐
193       MAT_DATE_OUT  and FORMAT_CLOCK_OUT, whereas general floating point val‐
194       ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for‐
195       mat  in effect can lead to loss of precision in ASCII output, which can
196       lead to various problems downstream. If you  find  the  output  is  not
197       written with enough precision, consider switching to binary output (-bo
198       if available) or specify more decimals using the FORMAT_FLOAT_OUT  set‐
199       ting.
200

EXAMPLES

202       To  generate  points  every  10km  along a great circle from 10N,50W to
203       30N,10W:
204
205              gmt project -C-50/10 -E-10/30 -G10 -Q > great_circle_points.xyp
206
207       (Note that great_circle_points.xyp could now be used as input for  grd‐
208       track, etc. ).
209
210       To  generate  points  every  1 degree along a great circle from 30N,10W
211       with azimuth 30 and covering a full 360, try:
212
213              gmt project -C10W/30N -A30 -G1 -L-180/180 > great_circle.txt
214
215       To generate points every 10km along a small  circle  of  colatitude  60
216       from 10N,50W to 30N,10W:
217
218              gmt project -C-50/10 -E-10/30 -G10/60 -Q > small_circle_points.xyp
219
220       To  create  a  partial  small  circle  of colatitude 80 about a pole at
221       40E,85N, with extent of 45 degrees  to  either  side  of  the  meridian
222       defined by the great circle from the pole to a point 15E,15N, try
223
224              gmt project -C15/15 -T40/85 -G1/80 -L-45/45 > some_circle.xyp
225
226       To   project  the  shiptrack  gravity,  magnetics,  and  bathymetry  in
227       c2610.xygmb along a great circle through an origin  at  30S,  30W,  the
228       great  circle having an azimuth of N20W at the origin, keeping only the
229       data from NE of the profile and within +/- 500 km of the origin, run:
230
231              gmt project c2610.xygmb -C-30/-30 -A-20 -W-10000/0 -L-500/500 -Fpz -Q > c2610_projected.pgmb
232
233       (Note in this example that -W-10000/0 is used to admit any value with a
234       large  negative  q coordinate. This will take those points which are on
235       our right as we walk along the great circle path, or to the NE in  this
236       example.)
237
238       To  make a Cartesian coordinate transformation of mydata.xy so that the
239       new origin is at 5,3 and the new x  axis  (p)  makes  an  angle  of  20
240       degrees with the old x axis, use:
241
242              gmt project mydata.xy -C5/3 -A70 -Fpq > mydata.pq
243
244       To  take  data in the file pacific.lonlat and transform it into oblique
245       coordinates using a pole from the hotspot reference frame  and  placing
246       the oblique zero meridian (p = 0 line) through Tahiti, run:
247
248              gmt project pacific.lonlat -T-75/68 -C-149:26/-17:37 -Fpq > pacific.pq
249
250       Suppose that pacific_topo.nc is a grid file of bathymetry, and you want
251       to make a file of flowlines in the hotspot reference frame. If you run:
252
253              gmt grd2xyz pacific_topo.nc | project -T-75/68 -C0/-90 -Fxyq | xyz2grd -Retc -Ietc -Cflow.nc
254
255       then flow.nc is a file in the same area as  pacific_topo.nc,  but  flow
256       contains  the  latitudes  about the pole of the projection. You now can
257       use grdcontour on flow.nc to draw lines of constant  oblique  latitude,
258       which are flow lines in the hotspot frame.
259
260       If  you  have  an arbitrarily rotation pole px/py and you would like to
261       draw an oblique small circle on a map, you will first need  to  make  a
262       file  with  the  oblique  coordinates for the small circle (i.e., lon =
263       0-360, lat is constant), then create a file with two records: the north
264       pole  (0/90)  and the origin (0/0), and find what their oblique coordi‐
265       nates are using your rotation pole. Now, use the projected  North  pole
266       and  origin  coordinates as the rotation pole and center, respectively,
267       and project your file as in the  pacific  example  above.   This  gives
268       coordinates for an oblique small circle.
269

SEE ALSO

271       fitcircle, gmt, gmtvector, grdtrack, mapproject, grdproject, grdtrack
272
274       2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
275
276
277
278
2795.4.5                            Feb 24, 2019                       PROJECT(1)
Impressum