Skip to main content
Solved

Convert points to lines

  • November 8, 2021
  • 7 replies
  • 145 views

Forum|alt.badge.img

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

Best answer by hkingsbury

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

hkingsbury
Celebrity
Forum|alt.badge.img+65
  • Celebrity
  • Best Answer
  • November 8, 2021

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


Forum|alt.badge.img
  • Author
  • November 9, 2021

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


hkingsbury
Celebrity
Forum|alt.badge.img+65
  • Celebrity
  • November 9, 2021

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/


Forum|alt.badge.img
  • Author
  • November 9, 2021

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


hkingsbury
Celebrity
Forum|alt.badge.img+65
  • Celebrity
  • November 9, 2021

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'


Forum|alt.badge.img
  • Author
  • November 9, 2021

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


geomancer
Evangelist
Forum|alt.badge.img+60
  • Evangelist
  • November 10, 2021

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