Skip to main content
Question

Line Direction to Arrow

  • April 22, 2015
  • 1 reply
  • 83 views

dos_gis
Contributor
Forum|alt.badge.img+3
I'm looking for a way to create a direction arrow symbol on top of a line segment.  Using PolylineAnalyzer I can get the direction of the line but how do I convert that to a arrow symbol? 

1 reply

takashi
Evangelist
  • April 23, 2015
Hi,

 

 

Supposing that your requirement is to create a triangle polygon as the arrowhead symbol.

 

After calculating the azimuth of the input line segment:

 

- create the end node point of the input line as top vertex of a isosceles triangle which points to north direction (Snipper),

 

- extract its coordinate (x, y) as attributes (CoordinateExtractor),

 

- calculate coordinates of the left/right vertices of bottom of the triangle based on the (x, y) of the top vertex (AttributeCreator),

 

- create a triangle polygon from the 3 coordinates (two VertexCreators and LineCloser),

 

- rotate it by proper angle around the (x, y) of the top vertex (Rotator).

 

 

Takashi

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