Calculates the geo distance between two locations using longitude and latitude, using Haversine, Speherical or Vincenty formula
MIT License
h1. GeoDistance - geo distance calculations
Calculates the Geo distance between two locations using longitude and latitude. This is done using "pure" Math formulas without resorting to Active Record or SQL DB functionality
This gem is meant to be a replacement for those geo distance utils out there that use built in SQL DB functionality for their calculations!
The formulas curently supported are
h2. Install & Usage
h2. Distance API
The call to distance returns an instance of GeoDistance
@dist = GeoDistance::Haversine.distance( lat1, lon1, lat2, lon2 )@
The #kms, #meters, #miles and #feet methods return an instance og GeoUnit
@dist.kms@
h3. Setting default algorithm
You can also set a default algorithm to use... The following will use the Haversine algorithm:
GeoDistance is used in the "geo_magic":https://github.com/kristianmandrup/geo_magic gem
h2. Contributing to geo-distance
h2. Copyright
Copyright (c) 2011 Kristian Mandrup. See LICENSE.txt for further details.