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:
within sql, pythagoras find, , order by, distance given point, wouldn't efficient.
Comments
Post a Comment