Skip to main content
Question

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


Forum|alt.badge.img

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

takashi
Evangelist
  • December 7, 2017

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.


Forum|alt.badge.img+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


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • December 7, 2017
takashi wrote:

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

 

 


Forum|alt.badge.img
  • Author
  • December 7, 2017

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?


takashi
Evangelist
  • December 7, 2017
nindalf wrote:

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


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