Provided by: gmt_4.5.11-1build1_amd64

**NAME**

grdproject - Forward and Inverse map transformation of 2-D grid files

**SYNOPSIS**

grdprojectin_grdfile-Gout_grdfile-Jparameters[-A[k|m|n|i|c|p] ] [-C[dx/dy] ] [-Dxinc[unit][=|+][/yinc[unit][=|+]] ] [-Edpi] [-F] [-I] [-Mc|i|m|p] [-Nnx/ny] [-Rwest/east/south/north[r] ] [-S[-]b|c|l|n[/threshold] ] [-V]

**DESCRIPTION**

grdprojectwill do one of two things depending whether-Ihas been set. If set, it will transform a gridded data set from a rectangular coordinate system onto a geographical system by resampling the surface at the new nodes. If not set, it will project a geographical gridded data set onto a rectangular grid. To obtain the value at each new node, its location is inversely projected back onto the input grid after which a value is interpolated between the surrounding input grid values. By default bi-cubic interpolation is used. Aliasing is avoided by also forward projecting the input grid nodes. If two or more nodes are projected onto the same new node, their average will dominate in the calculation of the new node value. Interpolation and aliasing is controlled with the-Soption. The new node spacing may be determined in one of several ways by specifying the grid spacing, number of nodes, or resolution. Nodes not constrained by input data are set to NaN. The-Roption can be used to select a map region larger or smaller than that implied by the extent of the grid file.in_grdfile2-D binary grid file to be transformed. (See GRID FILE FORMATS below.)-GSpecify the name of the output grid file. (See GRID FILE FORMATS below.)-JSelects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depending on theMEASURE_UNITsetting in .gmtdefaults4, but this can be overridden on the command line by appendingc,i, ormto the scale/width value. When central meridian is optional, default is center of longitude range on-Roption. Default standard parallel is the equator. For map height, max dimension, or min dimension, appendh,+, or-to the width, respectively. More details can be found in thepsbasemapman pages.CYLINDRICALPROJECTIONS:-Jclon0/lat0/scale(Cassini)-Jcyl_stere/[lon0/[lat0/]]scale(Cylindrical Stereographic)-Jj[lon0/]scale(Miller)-Jm[lon0/[lat0/]]scale(Mercator)-Jmlon0/lat0/scale(Mercator - Give meridian and standard parallel)-Jo[a]lon0/lat0/azimuth/scale(Oblique Mercator - point and azimuth)-Jo[b]lon0/lat0/lon1/lat1/scale(Oblique Mercator - two points)-Joclon0/lat0/lonp/latp/scale(Oblique Mercator - point and pole)-Jq[lon0/[lat0/]]scale(Cylindrical Equidistant)-Jtlon0/[lat0/]scale(TM - Transverse Mercator)-Juzone/scale(UTM - Universal Transverse Mercator)-Jy[lon0/[lat0/]]scale(Cylindrical Equal-Area)CONICPROJECTIONS:-Jblon0/lat0/lat1/lat2/scale(Albers)-Jdlon0/lat0/lat1/lat2/scale(Conic Equidistant)-Jllon0/lat0/lat1/lat2/scale(Lambert Conic Conformal)-Jpoly/[lon0/[lat0/]]scale((American) Polyconic)AZIMUTHALPROJECTIONS:-Jalon0/lat0[/horizon]/scale(Lambert Azimuthal Equal-Area)-Jelon0/lat0[/horizon]/scale(Azimuthal Equidistant)-Jflon0/lat0[/horizon]/scale(Gnomonic)-Jglon0/lat0[/horizon]/scale(Orthographic)-Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale(General Perspective).-Jslon0/lat0[/horizon]/scale(General Stereographic)MISCELLANEOUSPROJECTIONS:-Jh[lon0/]scale(Hammer)-Ji[lon0/]scale(Sinusoidal)-Jkf[lon0/]scale(Eckert IV)-Jk[s][lon0/]scale(Eckert VI)-Jn[lon0/]scale(Robinson)-Jr[lon0/]scale(Winkel Tripel)-Jv[lon0/]scale(Van der Grinten)-Jw[lon0/]scale(Mollweide)NON-GEOGRAPHICALPROJECTIONS:-Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))-Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]] (Linear, log, and power scaling)

**OPTIONS**

No space between the option flag and the associated arguments.-AForce 1:1 scaling, i.e., output (or input, see-I) data are in actual projected meters. To specify other units, appendk(km),m(mile),n(nautical mile),i(inch),c(cm), orp(points). Without-A, the output (or input, see-I) are in the units specified byMEASURE_UNIT(but see-M).-CLet projected coordinates be relative to projection center [Default is relative to lower left corner]. Optionally, add offsets in the projected units to be added (or subtracted when-Iis set) to (from) the projected coordinates, such as false eastings and northings for particular projection zones [0/0].-Dx_inc[and optionallyy_inc] is the grid spacing. Optionally, append a suffix modifier.Geographical(degrees)coordinates: Appendmto indicate arc minutes orcto indicate arc seconds. If one of the unitse,k,i, ornis appended instead, the increment is assumed to be given in meter, km, miles, or nautical miles, respectively, and will be converted to the equivalent degrees longitude at the middle latitude of the region (the conversion depends onELLIPSOID). If /y_incis given but set to 0 it will be reset equal tox_inc; otherwise it will be converted to degrees latitude.Allcoordinates: If=is appended then the corresponding maxx(east) ory(north) may be slightly adjusted to fit exactly the given increment [by default the increment may be adjusted slightly to fit the given domain]. Finally, instead of giving an increment you may specify thenumberofnodesdesired by appending+to the supplied integer argument; the increment is then recalculated from the number of nodes and the domain. The resulting increment value depends on whether you have selected a gridline-registered or pixel-registered grid; see Appendix B for details. Note: if-Rgrdfileis used then grid spacing has already been initialized; use-Dto override the values.-ESet the resolution for the new grid in dots per inch.-FToggle between pixel and gridline node registration [Default is same as input].-IDo the Inverse transformation, from rectangular to geographical.-MAppendc,i, ormto indicate that cm, inch, or meter should be the projected measure unit [Default is set byMEASURE_UNITin .gmtdefaults4]. Cannot be used with-A.-NSet the number of grid nodes in the new grid.-Rxmin,xmax,ymin, andymaxspecify the Region of interest. For geographic regions, these limits correspond towest,east,south,andnorthand you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Appendrif lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands-Rgand-Rdstand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). Alternatively, specify the name of an existing grid file and the-Rsettings (and grid spacing, if applicable) are copied from the grid. For calendar time coordinates you may either give (a) relative time (relative to the selectedTIME_EPOCHand in the selectedTIME_UNIT; appendtto-JX|x), or (b) absolute time of the form [date]T[clock] (appendTto-JX|x). At least one ofdateandclockmust be present; theTis always required. Thedatestring must be of the form [-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while theclockstring must be of the form hh:mm:ss[.xxx]. The use of delimiters and their type and positions must be exactly as indicated (however, input, output and plot formats are customizable; seegmtdefaults). You may ask to project only a subset of the grid by specifying a smaller inputw/e/s/nregion [Default is the region given by the grid file]. Special case for the UTM projection: If-Cand-Iare used and-Ris not given then the region is set to coincide with the given UTM zone so as to preserve the full ellipsoidal solution (See RESTRICTIONS for more information).-SSelect the interpolation mode by addingbfor B-spline smoothing,cfor bicubic interpolation,lfor bilinear interpolation, ornfor nearest-neighbor value (for example to plot categorical data). Optionally, prepend-to switch off antialiasing. Add/thresholdto control how close to nodes with NaNs the interpolation will go. Athresholdof 1.0 requires all (4 or 16) nodes involved in interpolation to be non-NaN. 0.5 will interpolate about half way from a non-NaN value; 0.1 will go about 90% of the way, etc. [Default is bicubic interpolation with antialiasing and a threshold of 0.5].-VSelects verbose mode, which will send progress reports to stderr [Default runs "silently"].

**GRID** **FILE** **FORMATS**

By defaultGMTwrites out grid as single precision floats in a COARDS-complaint netCDF file format. However,GMTis able to produce grid files in many other commonly used grid file formats and also facilitates so called "packing" of grids, writing out floating point data as 2- or 4-byte integers. To specify the precision, scale and offset, the user should add the suffix=id[/scale/offset[/nan]], whereidis a two-letter identifier of the grid type and precision, andscaleandoffsetare optional scale factor and offset to be applied to all grid values, andnanis the value used to indicate missing data. When reading grids, the format is generally automatically recognized. If not, the same suffix can be added to input grid file names. Seegrdreformat(1) and Section 4.17 of the GMT Technical Reference and Cookbook for more information. When reading a netCDF file that contains multiple grids,GMTwill read, by default, the first 2-dimensional grid that can find in that file. To coaxGMTinto reading another multi-dimensional variable in the grid file, append?varnameto the file name, wherevarnameis the name of the variable. Note that you may need to escape the special meaning of?in your shell program by putting a backslash in front of it, or by placing the filename and suffix between quotes or double quotes. The?varnamesuffix can also be used for output grids to specify a variable name different from the default: "z". Seegrdreformat(1) and Section 4.18 of the GMT Technical Reference and Cookbook for more information, particularly on how to read splices of 3-, 4-, or 5-dimensional grids.

**EXAMPLES**

To transform the geographical grid dbdb5.grd onto a pixel Mercator grid at 300 dpi, rungrdprojectdbdb5.grd-R20/50/12/25-Jm0.25i-E300-F-Gdbdb5_merc.grd To inversely transform the file topo_tm.grd back onto a geographical grid, usegrdprojecttopo_tm.grd-R-80/-70/20/40-Jt-75/1:500000-I-D5m-V-Gtopo.grd This assumes, of course, that the coordinates in topo_tm.grd were created with the same projection parameters. To inversely transform the file topo_utm.grd (which is in UTM meters) back to a geographical grid we specify a one-to-one mapping with meter as the measure unit:grdprojecttopo_utm.grd-R203/205/60/65-Ju5/1:1-I-Mm-Gtopo.grd-V

**RESTRICTIONS**

The boundaries of a projected (rectangular) data set will not necessarily give rectangular geographical boundaries (Mercator is one exception). In those cases some nodes may be unconstrained (set to NaN). To get a full grid back, your input grid may have to cover a larger area than you are interested in. For some projections, a spherical solution may be used despite the user having selected an ellipsoid. This occurs when the users-Rsetting implies a region that exceeds the domain in which the ellipsoidal series expansions are valid. These are the conditions: (1) Lambert Conformal Conic (-JL) and Albers Equal-Area (-JB) will use the spherical solution when the map scale exceeds 1.0E7. (2) Transverse Mercator (-JT) and UTM (-JU) will will use the spherical solution when either the west or east boundary given in-Ris more than 10 degrees from the central meridian, and (3) same for Cassini (-JC) but with a limit of only 4 degrees.

**SEE** **ALSO**

GMT(1),gmtdefaults(1),mapproject(1)