Skip to main content
Solved

Direction of a closed curve (line)?


ireen
Contributor
Forum|alt.badge.img+5
  • Contributor

I have to determine the direction of a closed curve (a line where start and endpoint are the same) because I want to derive a gpx in the right direction (clockwise) from the polyline. Is there a way to do this?

So I want to test if the polyline has a clockwise direction and, if not, reverse the direction.

I tried the Polylineanalyzer and the azimuthcalculator, but both don't give me a solution.

Best answer by takashi

Hi @ireen, I would try this.

  1. LineCloser: Transform the curve to an area.
  2. OrientationExtractor: Extract the orientation of the area.
  3. GeometryCoercer (Geometry Type: fme_line): Restore the original curve.

Note that the orientation may not be extracted correctly when the curve has self-intersections.

View original
Did this help you find an answer to your question?

4 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • May 19, 2017

Have you looked at the OrientationExtractor or Orientor?


ireen
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • May 19, 2017

Yes, I did, but both only work on areas, not on line features.


takashi
Influencer
  • Best Answer
  • May 19, 2017

Hi @ireen, I would try this.

  1. LineCloser: Transform the curve to an area.
  2. OrientationExtractor: Extract the orientation of the area.
  3. GeometryCoercer (Geometry Type: fme_line): Restore the original curve.

Note that the orientation may not be extracted correctly when the curve has self-intersections.


ireen
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • May 20, 2017
takashi wrote:

Hi @ireen, I would try this.

  1. LineCloser: Transform the curve to an area.
  2. OrientationExtractor: Extract the orientation of the area.
  3. GeometryCoercer (Geometry Type: fme_line): Restore the original curve.

Note that the orientation may not be extracted correctly when the curve has self-intersections.

Thanks a lot; this works fine!

 

 


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