Skip to main content
Question

How to convert Arithmetic Angles to Geographic Angles

  • December 2, 2020
  • 3 replies
  • 397 views

bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist

Not a question, but a Tip.

 

Sometimes there is a need to convert angles measured in Arithmetic convention (counter-clockwise from the X-Axis) to Geographic convention (clockwise from North/Y-Axis).

 

capture 

For example, Transformers like TopologyBuilder output Edge angles in Arithmetic degree angles whereas Desktop GIS systems like ArcGIS can sometimes default to Geographic degree angles.

 

Instead of using complicated Conditional Value formulae to translate angles quadrant by quadrant with different formulae, searching the internet came up with a genius single formulae that converts angles back and forth, no matter what quadrant the calculated angle is in.

Geographic Angle = (450 - Arithmetic Angle) mod 360

 

Rewriting the formula into FME Maths function format it becomes this

Geographic Angle = @fmod((450 - @Value(Arithmetic Angle)),360)

It also works in reverse:

Arithmetic Angle = @fmod((450 - @Value(Geographic Angle)),360)

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

Great piece. This should be a transformer.


david_r
Celebrity
  • December 2, 2020

Great tip, thanks for sharing. I agree that it would make for a great contribution to the FME Hub.


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • December 2, 2020

Thanks for the tip!


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