# gmtconnect¶

官方文档: gmtconnect 将端点接近的线段连接起来

## 选项¶

-C[<closed>]

-D[<template>]

<template> 是文件名的模板，该模板中必须包含一个整型参数的格式，比如 %d%08d ，也可以在整型参数格式前加上字符参数格式 %c ，实际 输出时会被C或O代替，分别表示closed和open。

-L[<linkfile>]

-Q[<template>]
Used with -D to a list file with the names of the individual output files. Optionally, append a filename template for the individual file names; this template may contain a C format specifier that can format an character (C or O for closed or open, respectively). [Default is gmtconnect_list.txt].
-T[<cutoff>[<unit>]][/<nn_dist>]
Specifies the separation tolerance in the data coordinate units [0]; append distance unit (see UNITS). If two lines has end-points that are closer than this cutoff they will be joined. Optionally, append /nn_dist which adds the requirement that a link will only be made if the second closest connection exceeds the nn_dist. The latter distance must be given in the same units as cutoff. However, if no arguments are given then we close every polygon regardless of the gap between first and last point.

## 示例¶

gmt connect segment_*.txt -Tf0.1 > new_segments.txt

gmt connect my_lines.txt -T150e -DMap_segment_%04d.dat