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?
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.

4 replies

jdh
Contributor
Forum|alt.badge.img+36
  • 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
Celebrity
  • 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