Skip to main content
Question

HorizontalAngleCalculator returning very small angles for obviously 45 degree lines

  • May 10, 2019
  • 11 replies
  • 197 views

Forum|alt.badge.img

I am trying to use the HorizontalAngleCalculator to calculate the angle of some lines but it seems that even lines that are quite obviously 45 degrees are getting strangley small angle values. I have checked it it is set to be in Degrees, I'm wondering if anybody can point out what is wrong.

 

 

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.

11 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • May 10, 2019

The expression within the horizontal angle calculator - in expressionevaluator 6 doesn't look right to me

@atan2(@Value(_Y2),@Value(_X2))-@atan2(@Value(_Y1),@Value(_X1))

I'd expect it to be

@atan2(@Value(_Y2)-@Value(_Y1),@Value(_X2)-@Value(_X1))

pat_uow
Contributor
Forum|alt.badge.img+1
  • Contributor
  • 26 replies
  • May 10, 2019

I understand that the calculation error in this transformer was corrected in a later version of the HAC on the FME Hub


Forum|alt.badge.img
  • 28 replies
  • May 22, 2019

Hi

I observe same phenomen, it seems that AzimuthCalculator hasn't been correctly "migrated" in FME.

I tries the two transformers , Azimuth is OK and Horizontal not ok.


nathanatsafe
Safer
Forum|alt.badge.img+9
  • Safer
  • 284 replies
  • May 27, 2019

Hi @iboates, thanks for your question.

 

 

As @egomm noted there does seem to be a calculation error inside the HorizontalAngleCalculator. We have an internal issue covering this bug and tracking the work needed to resolve it (FMEHUB-927). I will keep this post updated when the fix is complete.

 

 

For the time being feel free to edit the custom transformer and make the necessary changes to your local copy of it. You can do this by right-clicking the custom transformer, embedding it if it is not already, and then clicking "Edit".

 

 

Hope this helps,

 

Nathan

koenterralytics
Contributor
Forum|alt.badge.img+10

I've got the same issue with the HorizontalAngleCalculator. Unfortunately the azimuthcalculator is not available anymore.


koenterralytics
Contributor
Forum|alt.badge.img+10

The expression within the horizontal angle calculator - in expressionevaluator 6 doesn't look right to me

@atan2(@Value(_Y2),@Value(_X2))-@atan2(@Value(_Y1),@Value(_X1))

I'd expect it to be

@atan2(@Value(_Y2)-@Value(_Y1),@Value(_X2)-@Value(_X1))

When changing the value in the expressionevaluator_6 to the expression @egomm suggets, the custom transformer works. 


  • 1 reply
  • July 19, 2019

The expression within the horizontal angle calculator - in expressionevaluator 6 doesn't look right to me

@atan2(@Value(_Y2),@Value(_X2))-@atan2(@Value(_Y1),@Value(_X1))

I'd expect it to be

@atan2(@Value(_Y2)-@Value(_Y1),@Value(_X2)-@Value(_X1))

Thanks for this. Worked like a charm.


nathanatsafe
Safer
Forum|alt.badge.img+9
  • Safer
  • 284 replies
  • July 30, 2019

Hi all,

 

 

A new version (3) of this transformer has now been uploaded to FME Hub. This should contain the required fix stated by @egomm. Please let me know if this is still not working as expected.

 

 

Best,

 

Nathan

simtil
  • 2 replies
  • January 19, 2023

Version 3 is still not working for me.


simtil
  • 2 replies
  • January 19, 2023

Clarification, it works with the feature geometry method but not with the point coordinate method.


  • 1 reply
  • February 10, 2023

Clarification, it works with the feature geometry method but not with the point coordinate method.

I agree that it does not work with the point coordinate method