1GRDPROJECT(1) GMT GRDPROJECT(1)
2
3
4
6 grdproject - Forward and inverse map transformation of grids
7
9 grdproject in_grdfile -Gout_grdfile -Jparameters [ -C[dx/dy] ] [
10 -Dxinc[unit][+e|n][/yinc[unit][*+e|n]] ] [ -Edpi ] [
11 -F[c|i|p|e|f|k|M|n|u] ] [ -I ] [ -Mc|i|p ] [ -Rregion ] [ -V[level]
12 ] [ -nflags ] [ -r ]
13
14 Note: No space is allowed between the option flag and the associated
15 arguments.
16
18 grdproject will do one of two things depending whether -I has been set.
19 If set, it will transform a gridded data set from a rectangular coordi‐
20 nate system onto a geographical system by resampling the surface at the
21 new nodes. If not set, it will project a geographical gridded data set
22 onto a rectangular grid. To obtain the value at each new node, its
23 location is inversely projected back onto the input grid after which a
24 value is interpolated between the surrounding input grid values. By
25 default bi-cubic interpolation is used. Aliasing is avoided by also
26 forward projecting the input grid nodes. If two or more nodes are pro‐
27 jected onto the same new node, their average will dominate in the cal‐
28 culation of the new node value. Interpolation and aliasing is con‐
29 trolled with the -n option. The new node spacing may be determined in
30 one of several ways by specifying the grid spacing, number of nodes, or
31 resolution. Nodes not constrained by input data are set to NaN.
32
33 The -R option can be used to select a map region larger or smaller than
34 that implied by the extent of the grid file.
35
37 in_grdfile
38 2-D binary grid file to be transformed. (See GRID FILE FORMATS
39 below.)
40
41 -Gout_grdfile
42 Specify the name of the output grid file. (See GRID FILE FORMATS
43 below.)
44
45 -Jparameters (more ...)
46 Select map projection.
47
49 -C[dx/dy]
50 Let projected coordinates be relative to projection center
51 [Default is relative to lower left corner]. Optionally, add off‐
52 sets in the projected units to be added (or subtracted when -I
53 is set) to (from) the projected coordinates, such as false east‐
54 ings and northings for particular projection zones [0/0].
55
56 -Dxinc[unit][+e|n][/yinc[unit][+e|n]]
57 Set the grid spacing for the new grid. Append m for arc minute,
58 s for arc second. If neither -D nor -E are set then we select
59 the same number of output nodes as there are input nodes.
60
61 -Edpi Set the resolution for the new grid in dots per inch.
62
63 -F[c|i|p|e|f|k|M|n|u]
64 Force 1:1 scaling, i.e., output (or input, see -I) data are in
65 actual projected meters [e]. To specify other units, append f
66 (foot), k (km), M (statute mile), n (nautical mile), u (US sur‐
67 vey foot), i (inch), c (cm), or p (point). Without -F, the out‐
68 put (or input, see -I) are in the units specified by
69 PROJ_LENGTH_UNIT (but see -M).
70
71 -I Do the Inverse transformation, from rectangular to geographical.
72
73 -Mc|i|p
74 Append c, i, or p to indicate that cm, inch, or point should be
75 the projected measure unit [Default is set by PROJ_LENGTH_UNIT
76 in gmt.conf]. Cannot be used with -F.
77
78 -Rxmin/xmax/ymin/ymax[+r][+uunit] (more ...)
79 Specify the region of interest. You may ask to project only a
80 subset of the grid by specifying a smaller input w/e/s/n region
81 [Default is the region given by the grid file].
82
83 -V[level] (more ...)
84 Select verbosity level [c].
85
86 -n[b|c|l|n][+a][+bBC][+c][+tthreshold] (more ...)
87 Select interpolation mode for grids.
88
89 -r (more ...)
90 Set pixel node registration [gridline].
91
92 -^ or just -
93 Print a short message about the syntax of the command, then
94 exits (NOTE: on Windows just use -).
95
96 -+ or just +
97 Print an extensive usage (help) message, including the explana‐
98 tion of any module-specific option (but not the GMT common
99 options), then exits.
100
101 -? or no arguments
102 Print a complete usage (help) message, including the explanation
103 of all options, then exits.
104
106 By default GMT writes out grid as single precision floats in a
107 COARDS-complaint netCDF file format. However, GMT is able to produce
108 grid files in many other commonly used grid file formats and also
109 facilitates so called "packing" of grids, writing out floating point
110 data as 1- or 2-byte integers. (more ...)
111
113 To transform the geographical grid dbdb5.nc onto a pixel Mercator grid
114 at 300 dpi, run
115
116 gmt grdproject dbdb5.nc -R20/50/12/25 -Jm0.25i -E300 -r -Gdbdb5_merc.nc
117
118 To inversely transform the file topo_tm.nc back onto a geographical
119 grid, use
120
121 gmt grdproject topo_tm.nc -R-80/-70/20/40 -Jt-75/1:500000 -I -D5m -V -Gtopo.nc
122
123 This assumes, of course, that the coordinates in topo_tm.nc were cre‐
124 ated with the same projection parameters.
125
126 To inversely transform the file topo_utm.nc (which is in UTM meters)
127 back to a geographical grid we specify a one-to-one mapping with meter
128 as the measure unit:
129
130 gmt grdproject topo_utm.nc -R203/205/60/65 -Ju5/1:1 -I -Mm -Gtopo.nc -V
131
132 To inversely transform the file data.nc (which is in Mercator meters
133 with Greenwich as the central longitude and a false easting of -4 and
134 produced on the ellipse WGS-72) back to a geographical grid we specify
135 a one-to-one mapping with meter as the measure unit:
136
137 gmt grdproject data.nc -Jm/1:1 -I -F -C-4/0 -Gdata_geo.nc -V --PROJ_ELLIPSOID=WGS-72
138
140 The boundaries of a projected (rectangular) data set will not necessar‐
141 ily give rectangular geographical boundaries (Mercator is one excep‐
142 tion). In those cases some nodes may be unconstrained (set to NaN). To
143 get a full grid back, your input grid may have to cover a larger area
144 than you are interested in.
145
147 gmt, gmt.conf, mapproject
148
150 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
151
152
153
154
1555.4.5 Feb 24, 2019 GRDPROJECT(1)