Skip to main content
Question

How to draw a line between 2 points.

  • April 28, 2023
  • 1 reply
  • 916 views

gmbutler2
Contributor
Forum|alt.badge.img+10

I need to create lines between points. I had seen an article for similar in a different post saying a PointConnector was the way to go (Draw lines between points (safe.com)) but when I try to insert the PointConnector it puts in a LineBuilder which doesn't work. I need the end result to be something similar to the screenshot below where an individual line is drawn between every single point. How can I do this?

 

image

1 reply

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • April 28, 2023

Hi @gmbutler2​,

The NeighborFinder transformer can help you do this:

Screen Shot 2023-04-28 at 2.52.51 PMSet the NeighborFinder up as follows:

Screen Shot 2023-04-28 at 2.49.16 PMThis will create a list on each point containing the location of all the other points in the dataset. Explode this list into individual features, then use a VertexCreator to add a second point from the attributes containing the location of the other point, forming a line. You will end up with two lines between any two points, one in each direction. Filter these lines (if desired) using a Matcher transformer with lenient geometry matching to get a single line between any two points.


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