<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,<br>
</p>
<p>Open the vector file, open the field calculator, create a new
field with floats. Cut and paste this formula.<br>
</p>
<p>(atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) * 180/3.14159 + (180
*(((yat(-1)-yat(0)) < 0) + (((xat(-1)-xat(0)) < 0 AND
(yat(-1) - yat(0)) >0)*2)))</p>
<p>I think the new way to call the x of first node is: $x_at(0) and
not xat(0) but the above works.<br>
</p>
<p>There must be an easier way ...</p>
<p>NIcolas<br>
</p>
<div class="moz-cite-prefix">On 2021-01-09 2:46 a.m., Alejandro
Fernandez "Al" Tongco wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20628575.66017.1610178405750@mail.yahoo.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="ydp92d12c8eyahoo-style-wrap"
style="font-family:Helvetica Neue, Helvetica, Arial,
sans-serif;font-size:13px;">
<div>
<div dir="ltr" data-setdir="false">Thanks Nicolas for your
time.</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">I'm trying to use both
stand-alone SAGA (Snap Points to Polygons) to produce the
shortest line and QGIS to figure out the line angle
(line_interpolate_angle). As of now, I'm successful on the
former but not on the latter yet. I'll keep on trying...</div>
<div><br>
</div>
<div class="ydp92d12c8esignature">
<div style="font-family:Helvetica, Arial,
sans-serif;font-size:13px;">
<div style="font-family:Helvetica, Arial,
sans-serif;font-size:13px;"><font size="2"
face="garamond, new york, times, serif"><b>Alejandro
Fernandez "Al" Tongco</b> </font></div>
<div dir="ltr"><br>
<div style="font-family:Helvetica, Arial,
sans-serif;font-size:13px;"><br>
</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div id="ydpe0ddc338yahoo_quoted_1108368160"
class="ydpe0ddc338yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial,
sans-serif;font-size:13px;color:#26282a;">
<div> On Wednesday, December 30, 2020, 11:47:08 PM GMT+8,
Nicolas Cadieux <a class="moz-txt-link-rfc2396E" href="mailto:njacadieux.gitlab@gmail.com"><njacadieux.gitlab@gmail.com></a> wrote: </div>
<div><br>
</div>
<div><br>
</div>
<div>
<div id="ydpe0ddc338yiv3858002020">
<div>Hi,
<div>You can use the saga tool snap points to lines
found in the processing toolbox. Then ask for the
option to create the distance line (moves) and not the
new points. From that new line file, you can find the
angle (azimut) of the line using an expression using
the field calculator. </div>
<div><br clear="none">
</div>
<div><a shape="rect"
href="https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/functions_list.html#line-interpolate-point"
rel="nofollow" target="_blank"
moz-do-not-send="true">https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/functions_list.html#line-interpolate-point</a><br
clear="none">
<br clear="none">
<div dir="ltr">Nicolas Cadieux
<div><a shape="rect"
href="https://gitlab.com/njacadieux"
rel="nofollow" target="_blank"
moz-do-not-send="true">https://gitlab.com/njacadieux</a></div>
</div>
<div dir="ltr">
<div class="ydpe0ddc338yiv3858002020yqt1992050335"
id="ydpe0ddc338yiv3858002020yqtfd42184"><br
clear="none">
<blockquote type="cite">Le 30 déc. 2020 à 02:13,
Alejandro Fernandez "Al" Tongco
<a class="moz-txt-link-rfc2396E" href="mailto:al_tongco@yahoo.com"><al_tongco@yahoo.com></a> a écrit :<br
clear="none">
<br clear="none">
</blockquote>
</div>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="ydpe0ddc338yiv3858002020yqt1992050335"
id="ydpe0ddc338yiv3858002020yqtfd87152">
<div
class="ydpe0ddc338yiv3858002020yahoo-style-wrap"
style="font-family:Helvetica Neue, Helvetica,
Arial, sans-serif;font-size:13px;">
<div dir="ltr">Hello qgis users,</div>
<div dir="ltr"><br clear="none">
</div>
<div dir="ltr">I need help how to calculate
shortest length and angle of line connecting
a point and an area feature. I'm using QGIS
3.16 in Windows 10.</div>
<div dir="ltr"><br clear="none">
</div>
<div dir="ltr">Thank you in advance,</div>
<div dir="ltr"><br clear="none">
</div>
<div dir="ltr">Al</div>
</div>
</div>
<span>_______________________________________________</span><br
clear="none">
<span>Qgis-user mailing list</span><br
clear="none">
<span><a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a></span><br
clear="none">
<span>List info:
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br
clear="none">
<span>Unsubscribe:
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span>
<div class="ydpe0ddc338yiv3858002020yqt1992050335"
id="ydpe0ddc338yiv3858002020yqtfd71379"><br
clear="none">
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Nicolas Cadieux
<a class="moz-txt-link-freetext" href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a></pre>
</body>
</html>