<html><head></head><body>Depends on what you mean by direction. If you want to grab the start and end points (st_startpoint and st_endpoint) and check their x and y (st_x and st_y) for some condition (both less at the end?) Then update the record with the value of st_reverse.<br>
<br>
I guess my other question is why it matters.<br>
<br>
Jim<br><br><div class="gmail_quote">On September 13, 2016 8:31:07 AM EDT, Jonatan Malaver <jon.malaver@shrewsburyma.gov> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr">Hello,<div><br /></div><div>   I'm trying to come up with a query that would check the direction of a line. If the end point is not the start point of the next line to update the line by reversing that line. Can anyone give me pointers on how to do it?</div><div><br /></div><div>Thanks,</div><div>Jon</div></div>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre class="k9mail"><hr /><br />postgis-users mailing list<br />postgis-users@lists.osgeo.org<br /><a href="http://lists.osgeo.org/mailman/listinfo/postgis-users">http://lists.osgeo.org/mailman/listinfo/postgis-users</a></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>