calculate distance between several points --> calculate travelled distance

Hello everyone,

I would like to calculate the total distance travelled from recorded coordinates.
Using the nodes of Palladian I could already calculate the distance to all previous points (see picture).

The yellow marked value is the distance to the previous point. By adding up all these points I should be able to calculate the total distance. Unfortunately I can’t figure out how to do this, but I guess it’s very easy.

Many thanks in advance for your help.

Hi,

It looks like that your distance column is a list or set. You can try with Column expression node and transform the array (list or set) to string and then extract the last part of the string with right() function of the Column expression node for example.

1 Like

Hi,

If the column Distance is a list try this python code to extract the last element

input_table[‘LastDistance’] =input_table[‘Distance’].apply(lambda x: x[-1])
output_table = input_table

If the column Distance is a set first transform it to list

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.