I need to sort a set of addresses based on the distance from a specifc point. I have latitude and longitude for all these addressses,I am finding the distance with the below Java code.
Double theDistance = (Math.sin(Math.toRadians(latA)) * Math.sin(Math.toRadians(latB)) + Math.cos(Math.toRadians(latA)) * Math.cos(Math.toRadians(latB)) * Math.cos(Math.toRadians(longA - longB))); theDistance = (Math.toDegrees(Math.acos(theDistance))) * 69.09;\
But when I compare the results(I mean the sort order (not the actual distance)) with the actual Google map, they don't match. Is it the case always? or Am I not doing it correct?
We found that for Google/Yahoo map web service has some restrictions as a result we can't use in our application.
What is the best way to find the distance between two addresses given that you have the latitude and longitude.
preguntado el 08 de noviembre de 11 a las 15:11