Question

HorizontalAngleCalculator returning very small angles for obviously 45 degree lines


Badge

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

Userlevel 1
Badge +21

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))
Badge

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

Badge

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.

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

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

Badge +8

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. 

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.

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

Version 3 is still not working for me.

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

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

Reply