Question

Connect multiple points 1-to-M

  • 11 December 2017
  • 2 replies
  • 6 views

I have two point datasets (image below). There is a 1-to-many relationship between the yellow squares (1) and the red circles (many). The points are related by an ID attribute which is common to both datasets. I need to draw connecting lines from the yellow squares (the "hubs") to the red circles ("spokes") which share the same ID. I've read a number of previous posts regarding connecting points in separate datasets but they all seem to deal with either a single point connecting to many points or many-to-many relationships between datasets, but not a one-to-many relationship between two large (5,000+ rows) datasets. Any advice or info is much appreciated.

 

 

Cheers,

Rich


2 replies

Userlevel 2
Badge +16

Read both datasets. and use the FeatureMerger transformer (based on the common ID) to add the yellow data (Supplier) to the red (Requester) (attributes only). Before merging use the CoordinateExtractor to extract X and Y from the yellow data.

Use the option to generate lines using the VertexCreator (adding the X and Y from the yellow data).

If needed reverse the line using the Orientor transformer.

Thanks so much. That worked a treat.

Reply