Calculate Distance Based on Set Up Point

Hi, is there a way to calculate minimum distance available from each center point to list of data? for instance:
I have 3 fixed center points geotag (main Hub) and 1000 scattered geotags. I want know how many among 1000 scattered geotags would best assigned to each of those 3 center points. Instead of using k-means or other clustering method to decide which is the best center point, I want to use the current point to decide which goes to where using knime.

Center #Points
A 200
B 300
B 500

I have checked Distance between two geotag for calculation reference but it seems that I need to list all of the 3 center among 1000 scattered geotags and would resulted me 3000 rows.
Is there any better way to do this?

How about calculating the distance between all 1000 points and the three centers and then joining them together and creating a rule assigning the center with the shortest distance?

1 Like

That can do, but it will take longer time up front if I have >10 center right?

I am thinking about looping but to change the reference of 1000 points to all 3 center although I’m not sure how the workflow works

Could you advice on how after using joiner node connecting to the rule engine would result in a column of shortest distance? :slight_smile:

Agree with @mlauber71

3,000 rows doesn’t sound like awfully much? At the end, there would need to be 3 x 1,000 distance calculations anyways (whether they are visible or hidden within some node blackbox). So, your idea seems like the pragmatic and correct solution to me.

is there any way I could combine all the 3 center points table together and assign the rule based on shortest distance?

I used joiner node to do this but instead it gives me 3000 row, it just maintain 1000 row points and the column goes right using inner or right outer join

How about posting a sample workflow with your sample data? This makes it easier to get an idea …

1 Like

Hi @qqilihq

Please find below for my sample data & workflow. I only got to the point for distance calculation in each point but stuck on how to join them together and filter based on shortest distance on rule assigning.

Thanks for the help! :slight_smile:

Raw Point.xlsx (41.6 KB)
Test.knwf (262.9 KB)

I converted you example into a workflow that brings the three calculations together. The part with the join and unpivoting could also have been solved by a rule, but with this setting you could habe more points and it would still select the one with the minimum distance.

3 Likes

Thanks for this solution! exactly what I’m looking for :slight_smile:

3 Likes

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