Skip to main content
Question

HorizontalAngleCalculator returning very small angles for obviously 45 degree lines


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.

 

 

11 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • 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
  • 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

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+7

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+8

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


koenterralytics
Contributor
Forum|alt.badge.img+8
ebygomm wrote:

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. 


  • July 19, 2019
ebygomm wrote:

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+7

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
  • January 19, 2023

Version 3 is still not working for me.


simtil
  • January 19, 2023

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


simtil wrote:

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


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