Question

How to stroke arcs down to straight lines


Badge +3

I need to stroke arcs (within polygon geometries) down to straight lines (startpoint directly connected to endpoint, no additional vertices). How am I to realize this?

When I use ArcStroker with 'Number of Interpolated Edges' = 0, it would automatically interpolate a reasonable number of edges. However, when I choose 'Number of Interpolated Edges' = 1, it would add one more verex (edge). Any ideas with other than that transformer?


4 replies

Userlevel 2
Badge +17

Hi @frantsch, I think the ArcStroker (Number of Interpolated Edge: 1) should work to transform an arc into a single line segment between the start and end nodes. However, the result you have observed is reasonable if the input 'arc' consists of consecutive two arcs actually. Firstly check whether the 'arc' is a single arc feature.

Userlevel 2
Badge +17

I found that the ArcStroker strokes the 'arc' for each segment if the geometry is a path consisting of multiple arcs. If the input arc is a path containing two arc segments, try transforming it into a single arc by the ArcEstimator before stroking.

Badge +3

I found that the ArcStroker strokes the 'arc' for each segment if the geometry is a path consisting of multiple arcs. If the input arc is a path containing two arc segments, try transforming it into a single arc by the ArcEstimator before stroking.

Yes, you are right. All the arcs in my geometries consist of two consecutive arc segments, that was why I obtained those intermediate vertices. Thank you, Takashi!

Userlevel 2
Badge +16

If the ArcStroker results in a line with multiple vertices, you can extract the first (index = 0) and last (index = -1) coordinates from the line. Then you can replace the line with a straight line by using these coordinates. If the line has 3 vertices you can also remove the middle vertex (index = 1) using the CoordinateRemover.

Reply