Skip to main content

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.

Have you looked at the OrientationExtractor or Orientor?


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


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.


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!

 

 


Reply