Skip to main content

I've pairs of two nodes which have an offset in between. I need to add in the middle of each pair a new feature (see the left diagram). The first table shows the current list with the node pairs connected by the attribute ID. I like to create a new list with the new created node-features. Is there a way to solve this problem with existing transformers?

Hi @nindalf, a possible way is:

  1. Use the Aggregator (Group By: ID) to make a MultiPoint from two points belonging to the same ID.

  2. Use the CenterPointReplacer to convert the MultiPoint to the middle point.

If the goal is to extract coordinates as attributes, the CenterPointExtractor can be used instead.


@nindalf, a slight variation - you can use the LineBuilder to create a line per ID, and then use the CentrePointReplacer

capture.png capture.png


Hi @nindalf, a possible way is:

  1. Use the Aggregator (Group By: ID) to make a MultiPoint from two points belonging to the same ID.

  2. Use the CenterPointReplacer to convert the MultiPoint to the middle point.

If the goal is to extract coordinates as attributes, the CenterPointExtractor can be used instead.

A LineBuilder with a Group By ID could also be used instead of the aggregator

 

 


Ok, I will solve it this way. Is there a possibility to save the coordinates of the parent nodes as an attribute on the child node?


Ok, I will solve it this way. Is there a possibility to save the coordinates of the parent nodes as an attribute on the child node?

If you mean the two source points are "parent nodes" and the center of them is "child node", you can insert a CoordinateExtracor arter the Aggregator to extract coordinates of the parent nodes from the multi point feature.

 

 


Reply