Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added radian multipliers as suggested by niedhui

  • Loading branch information...
commit 0d0d635012f6d50b3e6d65d6d7f819f69f53a9a3 1 parent 147b753
Kristian Mandrup authored May 05, 2011

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. 16  lib/geo_magic/distance/conversion.rb
16  lib/geo_magic/distance/conversion.rb
@@ -91,6 +91,22 @@ def earth_factor u = nil
91 91
         (GeoMagic::Distance.earth_radius[u ||= unit] / 180) * lat_factor
92 92
       end
93 93
 
  94
+      # from mongoid-geo, as suggested by niedhui :)
  95
+      def radian_multiplier
  96
+        { 
  97
+          :feet => 364491.8,
  98
+          :ft => 364491.8,
  99
+          :m => 111170,
  100
+          :meter => 111170,
  101
+          :meters => 111170,
  102
+          :km => 111.17,
  103
+          :kms => 111.17,
  104
+          :mil => 69.407,
  105
+          :mile => 69.407,
  106
+          :miles => 69.407
  107
+        }
  108
+      end
  109
+
94 110
       def meters_map
95 111
         {
96 112
          :miles => 0.00062,

0 notes on commit 0d0d635

Please sign in to comment.
Something went wrong with that request. Please try again.