Skip to main content
Solved

calculating the heading

  • August 7, 2018
  • 3 replies
  • 55 views

Forum|alt.badge.img

I have a problem to calculate the heading of 2 points in a line in my template. In the 2 pictures you can see the template itself there i tried to take the start y-value.I used atan2 and also just a simple number. I tried with just 2 and 1 and i get a solution, but not if i use the attribute with "{geom:get-start-y()}".

Hope i get some help.

Best answer by david_r

Try using a FME Feature function rather than an XQuery function, e.g.

hdg="@atan2(@YValue(),1)"
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • August 7, 2018

Try using a FME Feature function rather than an XQuery function, e.g.

hdg="@atan2(@YValue(),1)"

Forum|alt.badge.img

Try using a FME Feature function rather than an XQuery function, e.g.

hdg="@atan2(@YValue(),1)"
It works ! Simple but i tried it 2 hours ;)

 

 

Thank you!

 

 


takashi
Celebrity
  • 7843 replies
  • August 7, 2018

Try using a FME Feature function rather than an XQuery function, e.g.

hdg="@atan2(@YValue(),1)"
Just for your information. The "math:atan2" in XQuery Math Functions can also be used. Note: the namespace should be declared before the expression.

 

declare namespace math="http://www.w3.org/2005/xpath-functions/math";
<example hdg="{math:atan2(geom:get-start-y(),1)}" />