Created
January 21, 2015 11:51
-
-
Save niksmac/a18a504309224d3adcb0 to your computer and use it in GitHub Desktop.
Drupal 7 Location Calculate distance between 2 location fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Location module has the function location_distance_between() (also in D7). | |
| It passes the call on to function earth_distance($longitude1, $latitude1, $longitude2, $latitude2), which lives inside the earth.inc file in the same package. | |
| See also: http://en.wikipedia.org/wiki/Great-circle_distance, which points out some of the intricacies of numerical calculation and accuracy of long vs short distances. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment