Provided by: gmt-manpages_3.4.4-1_all

**NAME**

triangulate - Perform optimal Delauney triangulation and gridding

**SYNOPSIS**

triangulateinfiles[-Dx|y] [-Eempty] [-Ggrdfile] [-H[nrec] ] [-Ix_inc[m|c][/y_inc[m|c]] ] [-Jparameters] [-L] [-M[flag] ] [-Rwest/east/south/north[r] ] [-V] [-Z] [-:] [-bi[s][n] ] [-bo[s][n] ]

**DESCRIPTION**

triangulatereads one or more ASCII [or binary] files (or standard input) containing x,y[,z] and performs Delauney triangulation, i.e., it find how the points should be connected to give the most equilateral triangulation possible. If a map projection is chosen then it is applied before the triangulation is calculated. By default, the output is triplets of point id numbers that make up each triangle and is written to standard output. The id numbers refer to the points position in the input file. As an option, you may choose to create a multiple segment file that can be piped throughpsxyto draw the triangulation network. If-G-Iare set a grid will be calculated based on the surface defined by the planar triangles. The actual algorithm used in the triangulations is either that of Watson [1982] [Default] or Shewchuck [1996] (if installed). This choice is made during the GMT installation.infilesData files with the point coordinates in ASCII (or binary; see-b). If no files are given the standard input is read.

**OPTIONS**

-DTake either thex- ory-derivatives of surface represented by the planar facets (only used when-Gis set).-ESet the value assigned to empty nodes when-Gis set [NaN].-GUse triangulation to grid the data onto an even grid (specified with-I,-R). Append the name of the output grid file. The interpolation is performed in the original coordinates, so if your triangles are close to the poles you are better off projecting all data to a local coordinate system before using triangulate (this is true of all gridding routines).-HInput file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used,GMTdefault is 1 header record.-Ix_inc[and optionallyy_inc] sets the grid size for optional grid output (see-G). Appendmto indicate minutes orcto indicate seconds.-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 the MEASURE_UNIT setting in .gmtdefaults, but this can be overridden on the command line by appending the c, i, or m to the scale/width value.CYLINDRICALPROJECTIONS:-Jclon0/lat0/scale(Cassini)-Jjlon0/scale(Miller)-Jmscale(Mercator - Greenwich and Equator as origin)-Jmlon0/lat0/scale(Mercator - Give meridian and standard parallel)-Joalon0/lat0/azimuth/scale(Oblique Mercator - point and azimuth)-Joblon0/lat0/lon1/lat1/scale(Oblique Mercator - two points)-Joclon0/lat0/lonp/latp/scale(Oblique Mercator - point and pole)-Jqlon0/scale(Equidistant Cylindrical Projection (Plate Carree))-Jtlon0/scale(TM - Transverse Mercator, with Equator as y = 0)-Jtlon0/lat0/scale(TM - Transverse Mercator, set origin)-Juzone/scale(UTM - Universal Transverse Mercator)-Jylon0/lats/scale(Basic Cylindrical Projection)AZIMUTHALPROJECTIONS:-Jalon0/lat0/scale(Lambert).-Jelon0/lat0/scale(Equidistant).-Jflon0/lat0/horizon/scale(Gnomonic).-Jglon0/lat0/scale(Orthographic).-Jslon0/lat0/[slat/]scale(General Stereographic)CONICPROJECTIONS:-Jblon0/lat0/lat1/lat2/scale(Albers)-Jdlon0/lat0/lat1/lat2/scale(Equidistant)-Jllon0/lat0/lat1/lat2/scale(Lambert)MISCELLANEOUSPROJECTIONS:-Jhlon0/scale(Hammer)-Jilon0/scale(Sinusoidal)-Jk[f|s]lon0/scale(Eckert IV (f) and VI (s))-Jnlon0/scale(Robinson)-Jrlon0/scale(Winkel Tripel)-Jvlon0/scale(Van der Grinten)-Jwlon0/scale(Mollweide)NON-GEOGRAPHICALPROJECTIONS:-Jp[a]scale[/origin] (polar (theta,r) coordinates, optionalafor azimuths and offset theta [0])-Jxx-scale[l|ppow][/y-scale[l|ppow]] (Linear, log, and power scaling) More details can be found in thepsbasemapmanpages.-LIndicates that the x column contains longitudes, which may differ from the region in-Rby [multiples of] 360 degrees [Default assumes no periodicity].-MOutput triangulation network as multiple line segments separated by a record whose first character isflag[>]. To plot, usepsxywith the-Moption (see Examples).-Rwest,east,south,andnorthspecify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Appendrif lower left and upper right map coordinates are given instead of wesn.-VSelects verbose mode, which will send progress reports to stderr [Default runs "silently"].-ZControls whether binary data file has two or three columns [2]. Ignored if-bis not set.-:Toggles between (longitude,latitude) and (latitude,longitude) input/output. [Default is (longitude,latitude)]. Applies to geographic coordinates only.-biSelects binary input. Appendsfor single precision [Default is double]. Appendnfor the number of columns in the binary file(s). [Default is 2 input columns].-boSelects binary output. Appendsfor single precision [Default is double]. Node ids are stored as binary 4-byte integer triplets.-bois ignored if-Mis selected.

**EXAMPLES**

To triangulate the points in the file samples.xyz, store the triangle information in a binary file, and make a grid for the given area and spacing, try triangulate samples.xyz-bo-R0/30/0/30-I2-Gsurf.grd > samples.ijk To draw the optimal Delauney triangulation network based on the same file using a 15 -cm- wide Mercator map, try triangulate samples.xyz-M-R-100/-90/30/34-JM15c| psxy-M-R-100/-90/30/34-JM15c-W0.5p-B1 > network.ps

**SEE** **ALSO**

gmt(1gmt),pscontour(1gmt)

**REFERENCES**

Watson, D. F., 1982, Acord: Automatic contouring of raw data,Comp.&Geosci.,8, 97-101. Shewchuck, J. R., 1996, Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator, First Workshop on Applied Computational Geometry (Philadelphia, PA), 124-133, ACM, May 1996. www.cs.cmu.edu/~quake/triangle.html 1 Jan 2004 TRIANGULATE(l)