Tuesday 19 March 2013

Calculate distance between two latitude longitude


In some web applications we will need to calculate the distance between two points on earth’s surface. Mainly this is for advertising purposes or to display locations based on distance. Up on considering the points as two places on earth’s surface, the shortest distance becomes the great circle distance. The great-circle or orthodromic distance is the shortest distance between any two points on the surface of a sphere measured along a path on the surface of the sphere (as opposed to going through the sphere's interior). You can calculate the distance based on this theory but it is already available in websites.

You can see the best one of them at http://www.geodatasource.com/distance-calculator

Also the code for various platforms is available at http://www.geodatasource.com/developers

By using this method of calculation you can find the distance in KM, Miles or in Nautical Miles according to your requirement.


Hope this helps !

No comments:

Post a Comment