# GRDPROJECT

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
RESTRICTIONS
SEE ALSO

## NAME

| grdproject − Forward and Inverse map transformation of 2-D grd files

## SYNOPSIS

| grdproject in_grdfile −J parameters −R west/east/south/north[r] [ −A[k|m|n|i|c|p] ] [ −C[dx/dy] ] [ −D xinc[unit][=|+][/yinc[unit][=|+]] ] [ −E dpi ] [ −F ] [ −G out_grdfile ] [ −I ] [ −Mc|i|m|p ] [ −N nx/ny ] [ −S search_radius ] [ −V ]

## DESCRIPTION

grdproject will do one of two things depending whether −I has 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. The new nodes are filled based on a simple weighted average of nearby points. Aliasing is avoided by using sensible values for the search_radius. 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.

|  | No space between the option flag and the associated arguments. Use upper case for the option flags and lower case for modifiers.

| in_grdfile

| 2-D binary grd file to be transformed.

| −J |  | Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depending on the MEASURE_UNIT setting in .gmtdefaults4, but this can be overridden on the command line by appending c, i, or m to the scale/width value. For map height, max dimension, or min dimension, append h, +, or - to the width, respectively.

More details can be found in the psbasemap man pages.

CYLINDRICAL PROJECTIONS:

−Jc lon0/lat0/scale (Cassini)
−Jj lon0/scale (Miller)
−Jm scale (Mercator - Greenwich and Equator as origin)
−Jm lon0/lat0/scale (Mercator - Give meridian and standard parallel)
−Joa lon0/lat0/azimuth/scale (Oblique Mercator - point and azimuth)
−Job lon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
−Joc lon0/lat0/lonp/latp/scale (Oblique Mercator - point and pole)
−Jq lon0/scale (Equidistant Cylindrical Projection (Plate Carree))
−Jt lon0/scale (TM - Transverse Mercator, with Equator as y = 0)
−Jt lon0/lat0/scale (TM - Transverse Mercator, set origin)
−Ju zone/scale (UTM - Universal Transverse Mercator)
−Jy lon0/lats/scale (Basic Cylindrical Projection)

AZIMUTHAL PROJECTIONS:

−Ja lon0/lat0/scale (Lambert)
−Je lon0/lat0/scale (Equidistant)
−Jf lon0/lat0/horizon/scale (Gnomonic)
−Jg lon0/lat0/scale (Orthographic)
−Js lon0/lat0/[slat/]scale (General Stereographic)

CONIC PROJECTIONS:

−Jb lon0/lat0/lat1/lat2/scale (Albers)
−Jd lon0/lat0/lat1/lat2/scale (Equidistant)
−Jl lon0/lat0/lat1/lat2/scale (Lambert)

MISCELLANEOUS PROJECTIONS:

−Jh lon0/scale (Hammer)
−Ji lon0/scale (Sinusoidal)
−Jk[f|s]lon0/scale (Eckert IV (f) and VI (s))
−Jn lon0/scale (Robinson)
−Jr lon0/scale (Winkel Tripel)
−Jv lon0/scale (Van der Grinten)
−Jw lon0/scale (Mollweide)

NON-GEOGRAPHICAL PROJECTIONS:

−Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
−Jx x-scale[d|l|p pow|t|T][/y-scale[d|l|p pow|t|T]] (Linear, log, and power scaling)

| −R |  | west, east, south, and north specify the Region of interest, and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of wesn. The two shorthands −Rg −Rd stand for global domain (0/360 or -180/+180 in longitude respectively, with -90/+90 in latitude).

## OPTIONS

| −A |  | Force 1:1 scaling, i.e., output (or input, see −I) data are in actual projected meters. To specify other units, append k (km), m (mile),n (nautical mile), i (inch), c (cm), or p (points). Without −A, the output (or input, see −I) are in the units specified by MEASURE_UNIT (but see −M).
| −C |  | Let 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 −I is set) to (from) the projected coordinates, such as false eastings and northings for particular projection zones [0/0].
| −D |  | Set the grid spacing for the new grid. Append m for minutes, c for seconds.
| −E |  | Set the resolution for the new grid in dots per inch.
| −F |  | Toggle between pixel and gridline registration [Default is same as input].
| −G |  | Specify the name of the output netCDF grd file.
| −I |  | Do the Inverse transformation, from rectangular to geographical.
| −M |  | Append c, i, or m to indicate that cm, inch, or meter should be the projected measure unit [Default is set by MEASURE_UNIT in .gmtdefaults4]. Cannot be used with −A.
| −N |  | Set the number of grid nodes in the new grid.
| −S |  | Set the search radius for the averaging procedure [Default avoids aliasing].
| −V |  | Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].

## EXAMPLES

To transform the geographical grid dbdb5.grd onto a pixel Mercator grid at 300 dpi, run

grdproject dbdb5.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, use

grdproject topo_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:

grdproject topo_utm.grd −R203/205/60/65 −Ju5/1:1 −I −Mm −V −Gtopo.grd

## 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 interrested in.

## SEE ALSO

| GMT(l), gmtdefaults(l), mapproject(l)