Hip, Simon,<div>Many thanks. I will try to test out soon.</div><div>I find postgis most amazing.</div><div>Regards, David<br><br>On Friday, 3 December 2021, Simon G Greener <<a href="mailto:simon@spatialdbadvisor.com">simon@spatialdbadvisor.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<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,<wbr>b.*),lead(ST_PointN(a.geom,b.*<wbr>))
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_<wbr>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>On 3/12/2021 9:46 am, Shaozhong SHI
wrote:<br>
</div>
<blockquote type="cite">
<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></fieldset>
<pre>______________________________<wbr>_________________
postgis-users mailing list
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
</div>
</blockquote></div>