Skip to main content
Solved

calculating the heading


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)"
View original
Did this help you find an answer to your question?

3 replies

david_r
Celebrity
  • 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
david_r wrote:

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
Evangelist
  • August 7, 2018
david_r wrote:

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)}" /> 

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings