Solved

Convert points to lines

  • 8 November 2021
  • 7 replies
  • 10 views

Badge

I am trying to figure out on how to be able to convert points to lines using a field attribute value from the point feature class. The center would be output to the center of the point and have a length equal to the attribute value on a specifc field, half of the length to the right and the other half to left of the point.

 

Thank you

icon

Best answer by hkingsbury 8 November 2021, 20:09

View original

7 replies

Userlevel 5
Badge +29

Have a look at the attached workbench. It makes use of the VectorShifter to create two new points and uses those to create a line

image

Badge

Have a look at the attached workbench. It makes use of the VectorShifter to create two new points and uses those to create a line

image

In my dataset I do not have any angle data. The goal for now that I have is getting the line output based on my length field of my point dataset disregarding the direction it will draw. How can I use the workbench you shared with me to modify it?

 

Thank you,

Gerardo Rodriguez

Userlevel 5
Badge +29

In my dataset I do not have any angle data. The goal for now that I have is getting the line output based on my length field of my point dataset disregarding the direction it will draw. How can I use the workbench you shared with me to modify it?

 

Thank you,

Gerardo Rodriguez

If you're just looking for it to be left/right of the point, set the direction to 90 on one of the VectorShifters and 180 on the other.

 

Your point source needs to replace the creator and you'll need to make sure the attribute with the line length is referenced in the magnitude field. Its likely you'll also need to set the groupby in the LineBuilder using a UID from the input point data to make sure you're creating a line for each input point.

 

Now I think about it, you can also achieve what you're after by using the offsetter https://www.safe.com/transformers/offsetter/

Badge

In my dataset I do not have any angle data. The goal for now that I have is getting the line output based on my length field of my point dataset disregarding the direction it will draw. How can I use the workbench you shared with me to modify it?

 

Thank you,

Gerardo Rodriguez

That worked! There is one thing though that is happening in the output which is offsetting the line from the point. Is there a specific reason why it is not drawing the line directly adjacent to point to where the center of line is the same coordinate as the point coordinate?

 

Thanks again!

Gerardo Rodriguez

Userlevel 5
Badge +29

In my dataset I do not have any angle data. The goal for now that I have is getting the line output based on my length field of my point dataset disregarding the direction it will draw. How can I use the workbench you shared with me to modify it?

 

Thank you,

Gerardo Rodriguez

Sorry, re reading my first post, the angles should actually be 0 and 180. this will give you 'left'/'right'

Badge

In my dataset I do not have any angle data. The goal for now that I have is getting the line output based on my length field of my point dataset disregarding the direction it will draw. How can I use the workbench you shared with me to modify it?

 

Thank you,

Gerardo Rodriguez

No worries, That made the difference. It works great!

 

Thank you for your support!

Gerardo Rodriguez

Userlevel 4
Badge +36

Alternatively you can use two VertexCreators. The first one, in 'Replace with Point' mode, moves the existing point half the desired length to the left. The second one, in 'Add Point' mode, creates a line from the new point to a second point the desired length to the right.

PointToLine

Reply