Question

How can I create a new node-feature based on existing nodes?

  • 7 December 2017
  • 5 replies
  • 0 views

Badge

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?


5 replies

Userlevel 2
Badge +17

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.

Badge +1

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

capture.png capture.png

Userlevel 1
Badge +21

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

 

 

Badge

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?

Userlevel 2
Badge +17

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