From b91e6e485bda3226105e7170aee9a962ed044cca Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Thu, 23 Nov 2023 11:24:28 +0100 Subject: [PATCH] A few changes Use factor instead of fact for clarity. Added missing +s description for -D documentation and added alias limits to range since latter is not good for PyGMT. Rest looks fine to me. --- doc/rst/source/gmtspatial.rst | 12 ++++++------ src/gmtspatial.c | 6 +++--- src/longopt/gmtspatial_inc.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/rst/source/gmtspatial.rst b/doc/rst/source/gmtspatial.rst index 7f452ee9857..5e018a32e9d 100644 --- a/doc/rst/source/gmtspatial.rst +++ b/doc/rst/source/gmtspatial.rst @@ -15,7 +15,7 @@ Synopsis **gmt spatial** [ *table* ] [ |-A|\ [**a**\ *min_dist*][*unit*]] [ |-C| ] -[ |-D|\ [**+a**\ *amax*][**+c\|C**\ *cmax*][**+d**\ *dmax*][**+f**\ *file*][**+p**][**+s**\ *fact*] ] +[ |-D|\ [**+a**\ *amax*][**+c\|C**\ *cmax*][**+d**\ *dmax*][**+f**\ *file*][**+p**][**+s**\ *factor*] ] [ |-E|\ **+p**\|\ **n** ] [ |-F|\ [**l**] ] [ |-I|\ [**e**\|\ **i**] ] @@ -85,7 +85,7 @@ Optional Arguments .. _-D: -**-D**\ [**+a**\ *amax*][**+c\|C**\ *cmax*][**+d**\ *dmax*][**+f**\ *file*][**+p**][**+s**\ *fact*] +**-D**\ [**+a**\ *amax*][**+c\|C**\ *cmax*][**+d**\ *dmax*][**+f**\ *file*][**+p**][**+s**\ *factor*] Check for duplicates among the input lines or polygons, or, if *file* is given via **+f**, check if the input features already exist among the features in *file*. We consider the cases of exact @@ -100,10 +100,10 @@ Optional Arguments single letter Y (exact match) or ~ (approximate match). If the two matching segments differ in length by more than a factor of 2 then we consider the duplicate to be either a subset (-) or a superset - (+). Finally, we also note if two lines are the result of splitting - a continuous line across the Dateline (|). - For polygons we also consider the fractional difference in - areas; duplicates must differ by less than *amax* [0.01]. By + (+). Use **+s** to set another *factor* than 2. Finally, we also + note if two lines are the result of splitting a continuous line across + the Dateline (|). For polygons we also consider the fractional difference + in areas; duplicates must differ by less than *amax* [0.01]. By default, we compute the mean line separation. Use **+C**\ *cmin* to instead compute the median line separation and therefore a robust closeness value. Also by default we consider all distances between diff --git a/src/gmtspatial.c b/src/gmtspatial.c index d4bc9117d18..35d5c843fa9 100644 --- a/src/gmtspatial.c +++ b/src/gmtspatial.c @@ -766,7 +766,7 @@ GMT_LOCAL struct NN_INFO *gmtspatial_NNA_update_info (struct GMT_CTRL *GMT, stru static int usage (struct GMTAPI_CTRL *API, int level) { const char *name = gmt_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_PURPOSE); if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); - GMT_Usage (API, 0, "usage: %s [] [-A[a]] [-C] [-D[+a][+c|C][+d][+f][+p][+s]] [-E+n|p] " + GMT_Usage (API, 0, "usage: %s [
] [-A[a]] [-C] [-D[+a][+c|C][+d][+f][+p][+s]] [-E+n|p] " "[-F[l]] [-I[i|e]] [-L%s//] [-N[+a][+i][+p[]][+r][+z]] [-Q[][+c[/]][+h][+l][+p][+s[a|d]]] [%s] " "[-Sb|h|i|j|s|u] [-T[]] [-W[][+f|l]] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]\n", name, GMT_DIST_OPT, GMT_Rgeo_OPT, GMT_V_OPT, GMT_a_OPT, GMT_b_OPT, GMT_d_OPT, GMT_e_OPT, GMT_f_OPT, GMT_g_OPT, GMT_h_OPT, GMT_i_OPT, GMT_j_OPT, GMT_o_OPT, GMT_q_OPT, GMT_s_OPT, GMT_colon_OPT, GMT_PAR_OPT); @@ -783,7 +783,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { "Considers 3rd column as z (if present) and 4th as w, if present [weight = 1]."); GMT_Usage (API, 1, "\n-C Clip polygons to the given region box (requires -R), possibly yielding new closed polygons. " "For truncation instead (possibly yielding open polygons, i.e., lines), see -T."); - GMT_Usage (API, 1, "\n-D[+a][+c|C][+d][+f][+p][+s]"); + GMT_Usage (API, 1, "\n-D[+a][+c|C][+d][+f][+p][+s]"); GMT_Usage (API, -2, "Look for (near-)duplicate lines or polygons. Duplicate lines have a minimum point separation less than and a closeness " "ratio (mean separation/length) less than . " "If near-duplicates have lengths that differ by or more then they are subsets or supersets. " @@ -795,7 +795,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { GMT_Usage (API, 3, "+d Set minimum mean point separation [0]."); GMT_Usage (API, 3, "+f Compare
against instead of itself."); GMT_Usage (API, 3, "+p limit comparison to points that project perpendicularly on to the other line [all points]."); - GMT_Usage (API, 3, "+s Set length ratio difference threshold [2]."); + GMT_Usage (API, 3, "+s Set length ratio difference threshold factor [2]."); GMT_Usage (API, 1, "\n-E+n|p"); GMT_Usage (API, -2, "Orient all polygons to have the same handedness:"); GMT_Usage (API, 3, "+n Impose clockwise (negative) handedness."); diff --git a/src/longopt/gmtspatial_inc.h b/src/longopt/gmtspatial_inc.h index 9bffc1ae390..b0268056a92 100644 --- a/src/longopt/gmtspatial_inc.h +++ b/src/longopt/gmtspatial_inc.h @@ -32,7 +32,7 @@ static struct GMT_KEYWORD_DICTIONARY module_kw[] = { { 0, 'C', "clip", "", "", "", "", GMT_TP_STANDARD }, { 0, 'D', "duplicates", "", "", - "a,c,C,d,f,p,s", "amax,cmax,cmin,dmax,file,perpendicular,fact", + "a,c,C,d,f,p,s", "amax,cmax,cmin,dmax,file,perpendicular,factor", GMT_TP_STANDARD }, { 0, 'E', "handedness", "", "", @@ -53,7 +53,7 @@ static struct GMT_KEYWORD_DICTIONARY module_kw[] = { GMT_TP_STANDARD }, { 0, 'Q', "centroid|area|length", "", "", - "c,h,l,p,s", "range,header,lines,close,sort", + "c,h,l,p,s", "range|limits,header,lines,close,sort", GMT_TP_STANDARD }, { 0, 'S', "spatial", "b,h,i,j,s,u", "buffer,hole,intersection,join,split,union",