Question

group by

  • 26 February 2020
  • 2 replies
  • 8 views

Badge

HEllo,

I want to create an attribute (distance) between two points. I am using AttributeCreator to do it. Here is the code:

@Evaluate(@sqrt((@Value(feature[+1].y)-@Value(y))*(@Value(feature[+1].y)-@Value(y))/(@Value(feature[+1].x)-@Value(x))*(@Value(feature[+1].x)-@Value(x))))

The problem is that I want to calculate it only between points where lineID is the same. How can I add a kind of group by?

Thanks


2 replies

Userlevel 1
Badge +21

You can use a conditional statement in the attributecreator, if @Value(LineID) = @Value(feature[+1].LineID) use the above expression, if not do nothing

Badge +2

@gylona or perhaps try the NeighborFinder?

Reply