<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Not that I am aware.</p>
<p>You could try wrapping something like the following SQL in a
function....</p>
<p><font face="monospace">with data as (<br>
select 0.01 as tolerance,<br>
ST_GeomFromText('LINESTRING(0 0 1.1,1 1.001 1.2,1
1.0005 1.3,1 1 1.1,2 2 1.2)',0) as geom<br>
)<br>
select SUM(isDuplicate) as duplicateCount<br>
from (select case when
ST_Distance(ST_PointN(a.geom,b.*),lead(ST_PointN(a.geom,b.*))
over (order by b.*)) < a.tolerance<br>
then 1<br>
else 0<br>
end as isDuplicate<br>
from data as a,<br>
generate_series(1,ST_NumPoints(a.geom),1) as b<br>
) as f;</font><br>
</p>
<p>Note that if the linestring was a compoundCurve repeated vertices
are part of the definition.</p>
<p>regards</p>
<p>Simon<br>
</p>
<div class="moz-cite-prefix">On 3/12/2021 9:46 am, Shaozhong SHI
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CA+i5JwbFzyxkNRjkdFyhmWfvrDtwa=yEMN8a+Pkn8QYrOjJijw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<p class="MsoNormal">Is there a generic function to find
coincident vertex and count?</p>
<p class="MsoNormal"><br>
</p>
<p class="MsoNormal">It will do the following:</p>
<p class="MsoNormal"><br>
</p>
<p class="MsoNormal">Create an array of all vertex present in
a data set<span></span></p>
<p class="MsoNormal">Iterate over and find out whether there
be any coincident
vertex as defined by a tolerance<span></span></p>
<p class="MsoNormal">Count all occurrences<span></span></p>
<p class="MsoNormal"><br>
</p>
<p class="MsoNormal">Regards,</p>
<p class="MsoNormal"><br>
</p>
<p class="MsoNormal">David</p>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/postgis-users">https://lists.osgeo.org/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
</body>
</html>