Geospatial Extension Nearest Join k result


I am would like to new if there is a possibility to find the nearest point from a table to an other, but instead of having the nearest point for each row I would like to have multiple results.

In fact, I would like to match two table bases on their location but It could be the 2nd or the 3rd nearest to be the good one and not the first match. So if i could have multiple result to find the nearest it will help me to figure out which it’s the good corresponding match.

I know I can use a cross joiner and calulate distance beetween each point to determinate wich are under a certain distance. But it would be a huge waste of time to use a cross table and have millions of rows to calculate.

IF the nearest Join can handle this would like to use it.

Important Note :Is There an issue with the Geospatial extension ? Because I have recently uptaded extension from the option and the node in my workflow are not recognized. I have already uninstall and install the extension but It doesn’t work.

Thank you

Hello @Grayfox ,
I’m afraid that the Geospatial Extension doesn’t support such a request as of now. I have opened a ticket to support the top k nearest neighbors in the Nearest Join node (Nearest Join node with option to return top k nearest points · Issue #323 · spatial-data-lab/knime-geospatial-extension · GitHub).

Maybe as a workaround you could use the K Nearest Neighbor node on the X and Y coordinates. Which would use the Euclidean distance but would be faster than computing all pairwise distance.

Regarding the problem with the extension we are investigating a potential problem (internal ticket AP-21938) and will find a solution hopefully soon.


1 Like

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