1SPHTRIANGULATE(1)                     GMT                    SPHTRIANGULATE(1)
2
3
4

NAME

6       sphtriangulate  - Delaunay or Voronoi construction of spherical lon,lat
7       data
8

SYNOPSIS

10       sphtriangulate [ table ] [  -A ] [  -C ] [  -D ] [  -Lunit ] [  -Nnfile
11       ]  [  -Qd|v ] [  -T ] [  -V[level] ] [ -bbinary ] [ -dnodata ] [ -ereg‐
12       exp ] [ -hheaders ] [ -iflags ] [ -:[i|o] ]
13
14       Note: No space is allowed between the option flag  and  the  associated
15       arguments.
16

DESCRIPTION

18       sphtriangulate  reads  one or more ASCII [or binary] files (or standard
19       input) containing lon, lat and performs a spherical Delaunay triangula‐
20       tion,  i.e.,  it  determines how the points should be connected to give
21       the most equilateral triangulation possible on the sphere.  Optionally,
22       you  may  choose  -Qv  which  will  do further processing to obtain the
23       Voronoi polygons. Normally, either set of polygons will be  written  as
24       closed fillable segment output; use -T to write unique arcs instead. As
25       an option, compute the area of each triangle or polygon. The  algorithm
26       used is STRIPACK.
27

REQUIRED ARGUMENTS

29       None.
30

OPTIONAL ARGUMENTS

32       table  One  or  more ASCII (or binary, see -bi[ncols][type]) data table
33              file(s) holding a number of data columns. If no tables are given
34              then we read from standard input.
35
36       -A     Compute  the  area  of the spherical triangles (-Qd) or polygons
37              (-Qv) and write the areas (in chosen units; see -L) in the  out‐
38              put segment headers [no areas calculated].
39
40       -C     For  large  data set you can save some memory (at the expense of
41              more processing) by only storing one form  of  location  coordi‐
42              nates  (geographic  or Cartesian 3-D vectors) at any given time,
43              translating from one form to the other when  necessary  [Default
44              keeps both arrays in memory].
45
46       -D     Used  to  skip  the last (repeated) input vertex at the end of a
47              closed segment if it equals the  first  point  in  the  segment.
48              [Default uses all points].
49
50       -Lunit Specify the unit used for distance and area calculations. Choose
51              among e (m), f (foot), k (km), m (mile), n  (nautical  mile),  u
52              (survey  foot),  or d (spherical degree). A spherical approxima‐
53              tion is used unless PROJ_ELLIPSOID is set to  an  actual  ellip‐
54              soid,  in  which case we convert latitudes to authalic latitudes
55              before calculating areas. When degree is selected the areas  are
56              given in steradians.
57
58       -Nnfile
59              Write  the information pertaining to each polygon. For Delaunay:
60              the three node number and the triangle area (if -A was set); for
61              Voronoi  the  unique  node  lon, lat and polygon area (if -A was
62              set)) to a separate file. This information is  also  encoded  in
63              the  segment  headers  of ASCII output files. Required if binary
64              output is needed.
65
66       -Qd|v  Append d for  Delaunay  triangles  or  v  for  Voronoi  polygons
67              [Delaunay].   If  -bo  is  used then -N may be used to specify a
68              separate file where the polygon information normally is written.
69
70       -T     Write the unique arcs of the construction [Default writes  fill‐
71              able  triangles  or  polygons].  When  used with -A we store arc
72              length in the segment header in chosen unit (see -L).
73
74       -V[level] (more ...)
75              Select verbosity level [c].
76
77       -bi[ncols][t] (more ...)
78              Select native binary input. [Default is 2 input columns].
79
80       -bo[ncols][type] (more ...)
81              Select native binary output. [Default is same as input].
82
83       -d[i|o]nodata (more ...)
84              Replace input columns that equal nodata  with  NaN  and  do  the
85              reverse on output.
86
87       -e[~]"pattern" | -e[~]/regexp/[i] (more ...)
88              Only accept data records that match the given pattern.
89
90       -h[i|o][n][+c][+d][+rremark][+rtitle] (more ...)
91              Skip or produce header record(s).
92
93       -:[i|o] (more ...)
94              Swap 1st and 2nd column on input and/or output.
95
96       -r (more ...)
97              Set pixel node registration [gridline].
98
99       -^ or just -
100              Print  a  short  message  about  the syntax of the command, then
101              exits (NOTE: on Windows just use -).
102
103       -+ or just +
104              Print an extensive usage (help) message, including the  explana‐
105              tion  of  any  module-specific  option  (but  not the GMT common
106              options), then exits.
107
108       -? or no arguments
109              Print a complete usage (help) message, including the explanation
110              of all options, then exits.
111

ASCII FORMAT PRECISION

113       The ASCII output formats of numerical data are controlled by parameters
114       in your gmt.conf file. Longitude and latitude are  formatted  according
115       to   FORMAT_GEO_OUT,  absolute  time  is  under  the  control  of  FOR‐
116       MAT_DATE_OUT and FORMAT_CLOCK_OUT, whereas general floating point  val‐
117       ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for‐
118       mat in effect can lead to loss of precision in ASCII output, which  can
119       lead  to  various  problems  downstream.  If you find the output is not
120       written with enough precision, consider switching to binary output (-bo
121       if  available) or specify more decimals using the FORMAT_FLOAT_OUT set‐
122       ting.
123

EXAMPLES

125       To triangulate the points in the file testdata.txt, and make a  Voronoi
126       diagram via psxy, use
127
128              gmt sphtriangulate testdata.txt -Qv | psxy -Rg -JG30/30/6i -L -P -W1p -Bag | gv -
129
130       To compute the optimal Delaunay triangulation network based on the mul‐
131       tiple segment file globalnodes.d and save the area of each triangle  in
132       the header record, try
133
134              gmt sphtriangulate globalnodes.d -Qd -A > global_tri.d
135

SEE ALSO

137       gmt, triangulate, sphdistance
138

REFERENCES

140       Renka, R, J., 1997, Algorithm 772: STRIPACK: Delaunay Triangulation and
141       Voronoi Diagram on the Surface of a Sphere, AMC Trans. Math.  Software,
142       23(3), 416-434.
143
145       2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
146
147
148
149
1505.4.5                            Feb 24, 2019                SPHTRIANGULATE(1)
Impressum