<div dir="ltr">And adding a ST_DumpSegments function would help make this (and other uses cases) simpler as well.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 4, 2020 at 2:51 PM Martin Davis <<a href="mailto:mtnclimb@gmail.com">mtnclimb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Good find.  And yes, the only approach currently that seems viable is to iterate over the segments in some way and select the closest.<div><br></div><div>Nowadays using LATERAL JOIN might make this a bit simpler. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 4, 2020 at 1:43 PM Bruce Rindahl <<a href="mailto:bruce.rindahl@gmail.com" target="_blank">bruce.rindahl@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I found this post from a few years back by Paul Ramsey:<br><a href="http://blog.cleverelephant.ca/2015/02/breaking-linestring-into-segments.html" target="_blank">http://blog.cleverelephant.ca/2015/02/breaking-linestring-into-segments.html</a> <div>One of the examples gives a collection of each segment of the line along with what you can use as an index.  Could you then query for the closest geometry from that collection and get the index number? <br></div><div>Sorry, I can't test right now as my pgadmin is not working.</div></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>
</blockquote></div>