java - Find the nearest neighbour / latitude and longitude -


i have table (db2 database) city information , corresponding latitude , longitude , many other info related city. requirement is:

input application latitude , longitude may or many not exact lat , long stored in db. need find nearest city info table of input latitude , longitude. highly appreciated.

is there nearest neighbor implementation in java available or sql handle this

you use kd-tree:

kdtree implementation in java

within sql, pythagoras find, , order by, distance given point, wouldn't efficient.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -