.TH GRDLANDMASK 1gmt "Feb 27 2014" "GMT 4.5.13 (SVN)" "Generic Mapping Tools" .SH NAME grdlandmask \- Create "wet-dry" mask grid file 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[\fI/min_level/max_level\fP][\fB+r\fP|\fBl\fP][\fBp\fP\fIpercent\fP] ] [ \fB\-D\fP\fIresolution\fP[\fB+\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 may be used in subsequent operations involving \fBgrdmath\fP to mask out data from land [or water] areas. .TP \fB\-G\fP Name of resulting output mask grid file. (See GRID FILE FORMATS below). .TP \fB\-I\fP \fIx_inc\fP [and optionally \fIy_inc\fP] is the grid spacing. Optionally, append a suffix modifier. \fBGeographical (degrees) coordinates\fP: Append \fBm\fP to indicate arc minutes or \fBc\fP to indicate arc seconds. If one of the units \fBe\fP, \fBk\fP, \fBi\fP, or \fBn\fP is 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 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. \fBAll coordinates\fP: 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 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 \fB\-R\fP\fIgrdfile\fP is used then grid spacing has already been initialized; use \fB\-I\fP to override the values. .TP \fB\-R\fP \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 w/e/s/n. The two shorthands \fB\-Rg\fP and \fB\-Rd\fP stand 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 \fB\-R\fP settings (and grid spacing, if applicable) are copied from the grid. .SH OPTIONS .TP \fB\-A\fP 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 not be plotted [Default is 0/0/4 (all features)]. Level 2 (lakes) contains regular lakes and wide river bodies which we normally include as lakes; append \fB+r\fP to just get river-lakes or \fB+l\fP to just get regular lakes (requires GSHHS 2.0.1 or higher). Finally, append \fB+p\fP\fIpercent\fP to exclude polygons whose percentage area of the corresponding full-resolution feature is less than \fIpercent\fP (requires GSHHS 2.0 or higher). See GSHHS INFORMATION below for more details. .TP \fB\-D\fP 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]. Append \fP+\fP to automatically select a lower resolution should the one requested not be available [abort if not found]. 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 \fB\-F\fP Force pixel node registration [Default is gridline registration]. (Node registrations are defined in \fBGMT\fP Cookbook Appendix B on grid file formats.) .TP \fB\-N\fP 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 \fB\-V\fP Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. .SH GRID FILE FORMATS By default \fBGMT\fP writes out grid as single precision floats in a COARDS-complaint netCDF file format. However, \fBGMT\fP is 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 \fB=\fP\fIid\fP[\fB/\fP\fIscale\fP\fB/\fP\fIoffset\fP[\fB/\fP\fInan\fP]], where \fIid\fP is a two-letter identifier of the grid type and precision, and \fIscale\fP and \fIoffset\fP are optional scale factor and offset to be applied to all grid values, and \fInan\fP is the value used to indicate missing data. See \fBgrdreformat\fP(1) and Section 4.17 of the GMT Technical Reference and Cookbook for more information. .P When writing a netCDF file, the grid is stored by default with the variable name "z". To specify another variable name \fIvarname\fP, append \fB?\fP\fIvarname\fP to the file name. Note that you may need to escape the special meaning of \fB?\fP in your shell program by putting a backslash in front of it, or by placing the filename and suffix between quotes or double quotes. .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\fP \fB\-i\fP 5\fBm\fP \fB\-N\fP 1/NaN \fB\-G\fP land_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\fP 0/360/-90/90 \fB\-Dl\fP \fB\-I\fP 1 \fB\-N\fP 0/1/2/3/4 \fB\-G\fP levels.grd \fB\-V\fP .SH GSHHS INFORMATION The coastline database is GSHHS which is compiled from two sources: World Vector Shorelines (WVS) and CIA World Data Bank II (WDBII). In particular, all level-1 polygons (ocean-land boundary) are derived from the more accurate WVS while all higher level polygons (level 2-4, representing land/lake, lake/island-in-lake, and island-in-lake/lake-in-island-in-lake boundaries) are taken from WDBII. Much processing has taken place to convert WVS and WDBII data into usable form for \fBGMT\fP: assembling closed polygons from line segments, checking for duplicates, and correcting for crossings between polygons. The area of each polygon has been determined so that the user may choose not to draw features smaller than a minimum area (see \fB\-A\fP); one may also limit the highest hierarchical level of polygons to be included (4 is the maximum). The 4 lower-resolution databases were derived from the full resolution database using the Douglas-Peucker line-simplification algorithm. The classification of rivers and borders follow that of the WDBII. See the \fBGMT\fP Cookbook and Technical Reference Appendix K for further details. .br .SH "SEE ALSO" .IR GMT (1), .IR grdmath (1), .IR grdclip (1), .IR psmask (1), .IR psclip (1), .IR pscoast (1)