NAME
triangulate - Perform optimal Delauney triangulation and
gridding
SYNOPSIS
triangulate infiles [ - Ggrdfile ] [ - H ] [ -
Ix_inc[m|c][/y_inc[m|c]] ] [ -Jparameters ] [ -M[flag] ] [ -
Rwest/east/south/north[r] ] [ -V ] [ - Z ] [ - : ] [ -
b[i|o][d] ]
DESCRIPTION
triangulate reads 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 con-
nected 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 tri-
plets 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
through psxy to draw the triangulation network. If G -I are
set a grid will be calculated based on the surface defined
by the planar triangles.
infiles
Data files with the point coordinates in ascii (or
binary; see - b). If no files are given the standard
input is read.
OPTIONS
-G Use triangulation to grid the data onto an even grid
(specified with -I, -R). Append the name of the output
grid file.
-H Input file(s) has Header record(s). Number of header
records can be changed by editing your .gmtdefaults
file. If used, GMT default is 1 header record.
-I x_inc [and optionally y_inc] sets the grid size for
optional grid output (see -G). Append m to indicate
minutes or c to indicate seconds.
-J Selects the map projection. Scale is inch/degree,
1:xxxxx. or width in inch (upper case modifier).
CYLINDRICAL PROJECTIONS:
-Jclon0/lat0/scale (Cassini)
-Jmscale (Mercator - Greenwich and Equator as origin)
-Jmlon0/lat0/scale (Mercator - Give meridian and stan-
dard 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)
-Juzone/scale (UTM - Universal Transverse Mercator)
-Jylon0/lats/scale (Basic Cylindrical Projection)
AZIMUTHAL PROJECTIONS:
-Jalon0/lat0/scale (Lambert).
-Jelon0/lat0/scale (Equidistant).
-Jglon0/lat0/scale (Orthographic).
-Jslon0/lat0/scale (General Stereographic)
CONIC PROJECTIONS:
-Jblon0/lat0/lat1/lat2/scale (Albers)
-Jllon0/lat0/lat1/lat2/scale (Lambert)
MISCELLANEOUS PROJECTIONS:
-Jhlon0/scale (Hammer)
-Jilon0/scale (Sinusoidal)
-Jklon0/scale (Eckert VI)
-Jnlon0/scale (Robinson)
-Jrlon0/scale (Winkel Tripel)
-Jwlon0/scale (Mollweide)
NON-GEOGRAPHICAL PROJECTIONS:
-Jpscale (Linear projection for polar (theta,r) coordi-
nates)
-Jxx-scale[l|ppow][/y-scale[l|ppow]] (Linear, log, and
power scaling)
More details can be found in the psbasemap manpages.
-M Output triangulation network as multiple line segments
separated by a record whose first character is flag
[>]. To plot, use psxy with the -M option (see Exam-
ples).
-R west, east, south, and north specify the Region of
interest. To specify boundaries in degrees and minutes
[and seconds], use the dd:mm[:ss] format. Append r if
lower left and upper right map coordinates are given
instead of wesn.
-V Selects verbose mode, which will send progress reports
to stderr [Default runs "silently"].
-Z Controls whether binary data file has two or three
columns [2]. Ignored if -b is not set.
- : Toggles between (longitude,latitude) and
(latitude,longitude) input/output. [Default is
(longitude,latitude)]
-b Selects binary input and output mode. Append i or o
to select binary input or output only. [Default is
ASCII]. Node ids are stored as binary 4-byte integer
triplets. Append d to indicate double precision for
binary data (if both binary input and output are
selected they will have the same precision). -bo is
ignored if -M is 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 6-inch-wide Mercator map, try
triangulate samples.xyz -M -R-100/-90/30/34 -JM6 | psxy -M -
R-100/-90/30/34 -JM6 -W2 -B1 > network.ps
SEE ALSO
gmt, pscontour
REFERENCES
Wessel, P., and W. H. F. Smith, 1995, The Generic Mapping
Tools (GMT) version 3.0 Technical Reference & Cookbook,
SOEST/NOAA.
Wessel, P., and W. H. F. Smith, 1995, New Version of the
Generic Mapping Tools Released, EOS Trans. AGU, 76, p. 329.
Wessel, P., and W. H. F. Smith, 1995, New Version of the
Generic Mapping Tools Released,
http://www.agu.org/eos_elec/95154e.html, Copyright 1995 by
the American Geophysical Union.
Wessel, P., and W. H. F. Smith, 1991, Free Software Helps
Map and Display Data, EOS Trans. AGU, 72, p. 441.
Watson, D. F., 1982, Acord: Automatic contouring of raw
data, Comp. & Geosci., 8, 97-101.