Question

How to offset line vertices along the direction of the line?

  • 8 January 2015
  • 4 replies
  • 24 views

Badge
I have a shp file of points along a path. For each point, I would like to have a new related point that is:

 

a) off set a meter to the left AND

 

b)  offset by a meter "behind" (in the direction of the line) 

 

 

I have done part a) by converting the points to a line using PointConnector and then using OffsetCurveGenerator and VertexExtractor to arrive at a point that is 1 meter to the left. However, I'm not sure how to tackle b) - how can I further offset this point along the direction of the line itself? 

4 replies

Userlevel 2
Badge +17
Hi,

 

 

One idea.

 

1) Connect the points with the PointConnector, like the solution for part a).

 

2) Chop the line into individual line segments with the Chopper.

 

Mode: By Vertex

 

Maximum Vertices: 2

 

3) Transform each line segment into a point behind one meter from its start node, along itself, by the Snipper.

 

Snipping Mode: Distance (Value)

 

Starting Location: 1

 

Ending Location: 1

 

 

Takashi
Badge +3
You can also use a PointOnLineOverlayer to chop up the line. Claculate the length of the pieces with Lenghtcalculator.

 

Now on the original line you offsetted, use a snipper and use the length + 1 meter starting form start (i assume vertexnr. = 0)

 

By making the snipper iterative (custom loop) you can repeat snipping process on the remnant tus moving all points.

 

After that extract the endnodes ( and the sart noed) or visa versa.

 

This will "move" them 1 meter along the line (you can even do that with curves/splines)

 

Create a
Badge +3
You can do this also using a cloner in stead of a looped snipper btw.
Badge +3
Here is a workspace using iterative snipping (this one is doen on a spline):

 

 

 

and the custom snipper:

 

 

 

 

Result, points moved 20 units along line: (exept 1st and last point. You could do 1st too if you'd wanted too of course)

 

 

 

Reply