.TH GRDLANDMASK l "15 May 2006" "GMT4.1.2" "GMT4.1.2"
.SH NAME
grdlandmask \- Create "wet-dry" mask grdfile from shoreline data base.
.SH SYNOPSIS
\fBgrdlandmask\fP \fB\-G\fP\fImask_grd_file\fP] \fB\-I\fP\fIxinc\fP[\fIunit\fP][\fB=\fP|\fB+\fP][/\fIyinc\fP[\fIunit\fP][\fB=\fP|\fB+\fP]] 
\fB\-R\fP\fIwest\fP/\fIeast\fP/\fIsouth\fP/\fInorth\fP[\fBr\fP] [ \fB\-A\fP\fImin_area\fP[/\fImin_level/max_level\fP] ] 
[ \fB\-D\fP\fIresolution\fP ] [ \fB\-F\fP ] [ \fB\-N\fP\fImaskvalues\fP[\fBo\fP] ] 
[ \fB\-V\fP ]
.SH DESCRIPTION
\fBgrdlandmask\fP reads the selected shoreline database and uses that information to decide which
nodes in the specified grid are over land or over water.  The nodes defined by
the selected region and lattice spacing will be set according to one of two criteria:
(1) land vs water, or (2) the more detailed (hierarchical) ocean vs land vs lake vs island vs pond.  The
resulting mask grdfile may be used in subsequent operations involving \fBgrdmath\fP to mask out
data from land [or water] areas.
.TP
.B \-G
Name of resulting output mask grd file.
.TP
.B \-I
\fIx_inc\fP [and optionally \fIy_inc\fP] is the grid spacing. Append \fBm\fP to
indicate minutes or \fBc\fP to indicate seconds.  If one of the units \fBe\fP, \fBk\fP, \fBi\fP,
or \fBn\fP is appended instead, the increment will be assumed to be 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 on \fBELLIPSOID\fP).  If /\fIy_inc\fP is given but set to 0 it will be reset equal to
\fIx_inc\fP; otherwise it will be converted to degrees latitude.  If \fB=\fP is appended then
the corresponding max \fIx\fP (\fIeast\fP) or \fIy\fP (\fInorth\fP) 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 the \fInumber of nodes\fP desired by appending \fB+\fP to
the supplied increment; 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.
.TP
.B \-R
\fIwest, east, south,\fP and \fInorth\fP 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 \fBr\fP if lower left and upper right
map coordinates are given instead of wesn.  The two shorthands \fB\-Rg \-Rd\fP stand for global domain
(0/360 or -180/+180 in longitude respectively, with -90/+90 in latitude).
.SH OPTIONS
.TP
.B \-A
Features with an area smaller than \fImin_area\fP in km^2 or of hierarchical level that is lower than \fImin_level\fP or higher than \fImax_level\fP
will be ignored [Default is 0/4 (all features)]. See DATABASE INFORMATION in the \fBpscoast\fP man-pages for more details.
.TP
.B \-D
Selects the resolution of the data set to use ((\fBf\fP)ull, (\fBh\fP)igh, (\fBi\fP)ntermediate, (\fBl\fP)ow, or (\fBc\fP)rude).  The
resolution drops off by ~80% between data sets. [Default is \fBl\fP].  Note that because the coastlines differ in details a
node in a mask file using one resolution is not guaranteed to remain inside [or outside] when a different resolution is selected.
.TP
.B \-F
Force pixel registration.  [Default is grid registration].
.TP
.B \-N
Sets the values that will be assigned to nodes.  Values can be any number, including the
textstring NaN.  Append \fBo\fP to let nodes exactly on feature boundaries be considered outside [Default is inside].
Specify this information using 1 of 2 formats:
.br
	\fB\-N\fP\fIwet/dry\fP.
.br
	\fB\-N\fP\fIocean/land/lake/island/pond\fP.
.br
[Default is 0/1/0/1/0 (i.e., 0/1)].
.TP
.B \-V
Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
.SH EXAMPLES
To set all nodes on land to NaN, and nodes over water to 1, using the high resolution data set, do
.br
.sp
\fBgrdlandmask\fP \fB\-R\fP-60/-40/-40/-30 \fB\-Dh  \-I\fP5\fBm \-N\fP1/NaN \fB\-G\fPland_mask.grd \fB\-V\fP
.br
.sp
To make a 1x1 degree global grid with the hierarchical levels of the nodes based on the low resolution data:
.br
.sp
\fBgrdlandmask\fP \fB\-R\fP0/360/-90/90 \fB\-Dl  \-I\fP1 \fB\-N\fP0/1/2/3/4 \fB\-G\fPlevels.grd \fB\-V\fP
.br
.SH "SEE ALSO"
.IR GMT (l),
.IR grdmath (l),
.IR grdclip (l),
.IR psmask (l),
.IR psclip (l),
.IR pscoast (l)
