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

NAME

6       project - project data along a line or great circle, generate a profile
7       track, or translate coordinates.
8

SYNOPSIS

10       project [ infile ] -Ccx/cy [ -Aazimuth ]  [  -Dd|g  ]  [  -Ebx/by  ]  [
11       -Fflags  ]  [  -Gdist  ]  [  -H[i][nrec]  ]  [  -L[w][l_min/l_max]  ] [
12       -M[i|o][flag] ] [ -N ] [ -Q ] [ -S ] [ -Tpx/py ] [ -V ] [ -Ww_min/w_max
13       ] [ -:[i|o] ] [ -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [ -f[i|o]colinfo ]
14

DESCRIPTION

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

OPTIONS

70       infile name  of  ASCII (or binary, see -bi) file(s) with 2 or more col‐
71              umns holding (x,y,[z]) data values.  If no filenames are  given,
72              project  will  read  from  standard  input.  If the -G option is
73              selected, no input data are read.
74
75       -F     Specify your desired output using any combination of xyzpqrs, in
76              any  order.   Do not space between the letters.  Use lower case.
77              The output will be ASCII (or binary, see -bo) columns of  values
78              corresponding  to  xyzpqrs  [Default].  If both input and output
79              are  using  ASCII  format  then  the  z  data  are  treated   as
80              textstring(s).  If the -G option is selected, the output will be
81              rsp.
82
83       -A     azimuth defines the azimuth of the projection (Definition 1).
84
85       -D     Set the location of the Discontinuity in  longitude  (r  coordi‐
86              nate).   -Dd will place the discontinuity at the Dateline, (-180
87              < r < 180); -Dg will place it at  Greenwich,  (0  <  r  <  360).
88              Default usually falls at dateline due to atan2 calls.
89
90       -E     bx/by  defines  the end point of the projection path (Definition
91              2).
92
93       -G     dist Generate mode.  No input is read.  Create (r, s, p)  output
94              points every dist units of p.  See -Q option.
95
96       -H     Input  file(s)  has  Header record(s).  Number of header records
97              can be changed by editing your .gmtdefaults4 file.  If used, GMT
98              default  is  1  header record. Use -Hi if only input data should
99              have header records [Default will write out  header  records  if
100              the input data have them]. Blank lines and lines starting with #
101              are always skipped.
102
103       -L     Length controls.  Project only those points whose  p  coordinate
104              is  within  l_min < p < l_max.  If -E has been set, then you may
105              use -Lw to stay within the distance from C to E.
106
107       -M     Multiple segment file(s).  Segments are separated by  a  special
108              record.   For  ASCII  files  the  first  character  must be flag
109              [Default is '>'].  For binary files all fields must be  NaN  and
110              -b must set the number of output columns explicitly.  By default
111              the -M setting applies to both input and output.   Use  -Mi  and
112              -Mo to give separate settings.
113
114       -N     Flat  Earth.   Make a Cartesian coordinate transformation in the
115              plane.  [Default uses spherical trigonometry.]
116
117       -Q     Map type units, i.e., project assumes x, y, r, s are in  degrees
118              while  p,  q, dist, l_min, l_max, w_min, w_max are in km.  If -Q
119              is not set, then all these are assumed to be in the same units.
120
121       -S     Sort the output into increasing p order.  Useful when projecting
122              random data into a sequential profile.
123
124       -T     px/py  sets the position of the roTation pole of the projection.
125              (Definition 3).
126
127       -V     Selects verbose mode, which will send progress reports to stderr
128              [Default runs "silently"].
129
130       -W     Width controls.  Project only those points whose q coordinate is
131              within w_min < q < w_max.
132
133       -:     Toggles between  (longitude,latitude)  and  (latitude,longitude)
134              input and/or output.  [Default is (longitude,latitude)].  Append
135              i to select input only or o to  select  output  only.   [Default
136              affects both].
137
138       -bi    Selects binary input.  Append s for single precision [Default is
139              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
140              Optionally,  append  ncol,  the number of columns in your binary
141              input file if it exceeds the columns needed by the program.   Or
142              append  c  if  the  input  file  is  netCDF.  Optionally, append
143              var1/var2/... to specify the variables to be read.  [Default  is
144              2 input columns].
145
146       -bo    Selects  binary  output.  Append s for single precision [Default
147              is d (double)].  Uppercase S  or  D  will  force  byte-swapping.
148              Optionally,  append  ncol, the number of desired columns in your
149              binary output file.  [Default is given by -F or -G].
150
151       -f     Special formatting of input and/or output columns (time or  geo‐
152              graphical  data).   Specify  i  or  o to make this apply only to
153              input or output [Default applies to both].   Give  one  or  more
154              columns (or column ranges) separated by commas.  Append T (abso‐
155              lute calendar time), t (relative time in chosen TIME_UNIT  since
156              TIME_EPOCH),  x (longitude), y (latitude), or f (floating point)
157              to each column or column range item.  Shorthand  -f[i|o]g  means
158              -f[i|o]0x,1y (geographic coordinates).
159

ASCII FORMAT PRECISION

161       The ASCII output formats of numerical data are controlled by parameters
162       in your .gmtdefaults4  file.   Longitude  and  latitude  are  formatted
163       according  to  OUTPUT_DEGREE_FORMAT, whereas other values are formatted
164       according to D_FORMAT.  Be aware that the format in effect can lead  to
165       loss  of  precision  in  the output, which can lead to various problems
166       downstream.  If you find the output is not written with  enough  preci‐
167       sion, consider switching to binary output (-bo if available) or specify
168       more decimals using the D_FORMAT setting.
169

EXAMPLES

171       To generate points every 10km along a  great  circle  from  10N,50W  to
172       30N,10W:
173
174       project -C-50/10 -E-10/30 -G10 -Q > great_circle_points.xyp
175
176       (Note  that great_circle_points.xyp could now be used as input for grd‐
177       track, etc. ).
178
179       To  project  the  shiptrack  gravity,  magnetics,  and  bathymetry   in
180       c2610.xygmb  along  a  great  circle through an origin at 30S, 30W, the
181       great circle having an azimuth of N20W at the origin, keeping only  the
182       data from NE of the profile and within +/- 500 km of the origin, run:
183
184       project  c2610.xygmb  -C-30/-30  -A-20  -W-10000/0 -L-500/500 -Fpz -Q >
185       c2610_projected.pgmb
186
187       (Note in this example that -W-10000/0 is used to admit any value with a
188       large  negative q coordinate.  This will take those points which are on
189       our right as we walk along the great circle path, or to the NE in  this
190       example.)
191
192       To  make a Cartesian coordinate transformation of mydata.xy so that the
193       new origin is at 5,3 and the new x  axis  (p)  makes  an  angle  of  20
194       degrees with the old x axis, use:
195
196       project mydata.xy -C5/3 -A70 -Fpq > mydata.pq
197
198       To  take  data in the file pacific.lonlat and transform it into oblique
199       coordinates using a pole from the hotspot reference frame  and  placing
200       the oblique zero meridian (p = 0 line) through Tahiti, run:
201
202       project pacific.lonlat -T-75/68 -C-149:26/-17:37 -Fpq > pacific.pq
203
204       Suppose  that  pacific_topo.grd  is  a grid file of bathymetry, and you
205       want to make a file of flowlines in the hotspot  reference  frame.   If
206       you run:
207
208       grd2xyz  pacific_topo.grd  |  project  -T-75/68 -C0/-90 -Fxyq | xyz2grd
209       -Retc -Ietc -Cflow.grd
210
211       then flow.grd is a file in the same area as pacific_topo.grd, but  flow
212       contains  the  latitudes about the pole of the projection.  You now can
213       use grdcontour on flow.grd to draw lines of constant oblique  latitude,
214       which are flow lines in the hotspot frame.
215
216       If  you  have  an arbitrarily rotation pole px/py and you would like to
217       draw an oblique small circle on a map, you will first need  to  make  a
218       file  with  the  oblique  coordinates for the small circle (i.e., lon =
219       0-360, lat is constant), then create a file with two records: the north
220       pole  (0/90)  and the origin (0/0), and find what their oblique coordi‐
221       nates are using your rotation pole.  Now, use the projected North  pole
222       and  origin  coordinates as the rotation pole and center, respectively,
223       and project your file as in the  pacific  example  above.   This  gives
224       coordinates for an oblique small circle.
225

SEE ALSO

227       fitcircle(1), GMT(1), mapproject(1), grdproject(1)
228
229
230
231GMT 4.3.1                         15 May 2008                       PROJECT(1)
Impressum