<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE</filename>
    </added>
    <added>
      <filename>Manifest.txt</filename>
    </added>
    <added>
      <filename>init.rb</filename>
    </added>
    <added>
      <filename>lib/graticule/distance/spherical.rb</filename>
    </added>
    <added>
      <filename>lib/graticule/distance/vincenty.rb</filename>
    </added>
    <added>
      <filename>lib/graticule/version.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -0,0 +1,8 @@
+
+0.1.1
+* fixed bug in Yahoo that raised error when street address not returned
+* migrated to Hoe (http://seattlerb.rubyforge.org/hoe/)
+* added Haversine, Spherical and Vincenty distance calculations
+
+0.1 (2006-10-31)
+* Initial release
\ No newline at end of file</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ Graticule is a geocoding API for looking up address coordinates.  It supports su
 
 = Usage
 
+  require 'rubygems'
   require 'graticule'
-  geocoder = Graticle.service(:google).new &quot;api_key&quot;
+  geocoder = Graticule.service(:google).new &quot;api_key&quot;
   location = geocoder.locate &quot;61 East 9th Street, Holland, MI&quot;</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,110 +1,15 @@
 require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
-require 'rake/contrib/rubyforgepublisher'
-
-
-PKG_VERSION = &quot;0.1.0&quot;
-PKG_NAME = &quot;graticule&quot;
-PKG_FILE_NAME = &quot;#{PKG_NAME}-#{PKG_VERSION}&quot;
-
-PKG_FILES = FileList[
-    &quot;lib/**/*&quot;, &quot;examples/**/*&quot;, &quot;[A-Z]*&quot;, &quot;rakefile&quot;
-].exclude(/\.svn$/)
-
-
-desc &quot;Default Task&quot;
-task :default =&gt; [ :test ]
-
-# Run the unit tests
-
-Rake::TestTask.new(:test) do |t|
-  t.pattern = 'test/unit/**/*_test.rb'
-  t.ruby_opts &lt;&lt; '-rubygems'
-  t.verbose = true
-end
-
-Rake::TestTask.new(:test_remote) do |t|
-  t.pattern = 'test/remote_tests/*_test.rb'
-  t.ruby_opts &lt;&lt; '-rubygems'
-  t.verbose = true
-end
-
-# Genereate the RDoc documentation
-Rake::RDocTask.new do |rdoc|
-  rdoc.rdoc_dir = 'doc'
-  rdoc.title    = &quot;Graticule Geocoding Library&quot;
-  rdoc.options &lt;&lt; '--line-numbers' &lt;&lt; '--inline-source'
-  rdoc.rdoc_files.include('README', 'CHANGELOG')
-  rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-task :install =&gt; [:package] do
-  `gem install pkg/#{PKG_FILE_NAME}.gem`
-end
-
-task :lines do
-  lines = 0
-  codelines = 0
-  Dir.foreach(&quot;lib&quot;) { |file_name| 
-    next unless file_name =~ /.*rb/
-
-    f = File.open(&quot;lib/&quot; + file_name)
-
-    while line = f.gets
-      lines += 1
-      next if line =~ /^\s*$/
-      next if line =~ /^\s*#/
-      codelines += 1
-    end
-  }
-  puts &quot;Lines #{lines}, LOC #{codelines}&quot;
-end
-
-desc &quot;Publish the gem&quot;
-task :publish =&gt; [:rdoc, :package] do
-  Rake::SshFilePublisher.new(&quot;host.collectiveidea.com&quot;, &quot;/var/www/vhosts/source.collectiveidea.com/public/dist/pkg&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.zip&quot;).upload
-  Rake::SshFilePublisher.new(&quot;host.collectiveidea.com&quot;, &quot;/var/www/vhosts/source.collectiveidea.com/public/dist/pkg&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.tgz&quot;).upload
-  Rake::SshFilePublisher.new(&quot;host.collectiveidea.com&quot;, &quot;/var/www/vhosts/source.collectiveidea.com/public/dist/gems&quot;, &quot;pkg&quot;, &quot;#{PKG_FILE_NAME}.gem&quot;).upload
-  `ssh host.collectiveidea.com &quot;mkdir -p /var/www/vhosts/source.collectiveidea.com/public/dist/api/#{PKG_NAME}&quot;`
-  Rake::SshDirPublisher.new(&quot;host.collectiveidea.com&quot;, &quot;/var/www/vhosts/source.collectiveidea.com/public/dist/api/#{PKG_NAME}&quot;, &quot;doc&quot;).upload
-end
-
-desc &quot;Delete tar.gz / zip / rdoc&quot;
-task :cleanup =&gt; [ :rm_packages, :clobber_rdoc ]
-
-task :install =&gt; [:package] do
-  `gem install pkg/#{PKG_FILE_NAME}.gem`
-end
-
-spec = Gem::Specification.new do |s|
-  s.name = PKG_NAME
-  s.version = PKG_VERSION
-  s.summary = &quot;Library for using various geocoding APIs.&quot;
-
-  s.files = %w(README LICENSE CHANGELOG) + Dir['lib/**/*']  
-
-  s.has_rdoc = true
-  s.extra_rdoc_files = %w( README )
-  s.rdoc_options.concat ['--main',  'README']
-  
-  s.require_path = 'lib'
-  s.autorequire  = 'graticule'
-  s.author = &quot;Brandon Keepers&quot;
-  s.email = &quot;brandon@opensoul.org&quot;
-  s.homepage = &quot;&quot;  
-end
-
-Rake::GemPackageTask.new(spec) do |p|
-  p.gem_spec = spec
+require 'hoe'
+require File.join(File.dirname(__FILE__), 'lib', 'graticule', 'version.rb')
+
+Hoe.new(&quot;graticule&quot;, Graticule::Version) do |p|
+  p.rubyforge_name = &quot;graticule&quot;
+  p.author = 'Brandon Keepers'
+  p.email = 'brandon@opensoul.org'
+  p.summary = &quot;API for using all the popular geocoding services.&quot;
+  p.description = 'Graticule is a geocoding API that provides a common interface to all the popular services, including Google, Yahoo, Geocoder.us, and MetaCarta.'
+  p.url = 'http://graticule.rubyforge.org'
   p.need_tar = true
   p.need_zip = true
-end
-
-desc &quot;Continuously watch unit tests&quot;
-task :watch do
-  system(&quot;clear&quot;)
-  system(&quot;stakeout \&quot;rake\&quot; `find . -name '*.rb'`&quot;)
+  p.test_globs = ['test/**/*_test.rb']
 end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-
 $:.unshift(File.dirname(__FILE__))      
 
 require 'graticule/location'
@@ -11,3 +10,5 @@ require 'graticule/geocoders/geocoder_us'
 require 'graticule/geocoders/meta_carta'
 require 'graticule/distance'
 require 'graticule/distance/haversine'
+require 'graticule/distance/spherical'
+require 'graticule/distance/vincenty'</diff>
      <filename>lib/graticule.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,11 @@
 module Graticule
   module Distance
+    EARTH_RADIUS = { :kilometers =&gt; 6378.135, :miles =&gt; 3963.1676 }
+    # WGS-84 numbers
+    EARTH_MAJOR_AXIS_RADIUS = { :kilometers =&gt; 6378.137, :miles =&gt; 3963.19059 }
+    EARTH_MINOR_AXIS_RADIUS = { :kilometers =&gt; 6356.7523142, :miles =&gt; 3949.90276 }
+
     class DistanceFormula
-      EARTH_RADIUS = { :kilometers =&gt; 6378.135, :miles =&gt; 3963.1676 }
       
       def initialize
         raise NotImplementedError</diff>
      <filename>lib/graticule/distance.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,64 @@
 
 module Graticule
   module Distance
+
+    #
+    # Thanks to Chris Veness for distance formulas.
+    #   * http://www.movable-type.co.uk/scripts/LatLong.html
+    #
+    # Distance Measured usign the Haversine Formula
+    # Works better at small distances than the Spherical Law of Cosines
+    # R = earth&#8217;s radius (mean radius = 6,371km)
+    # &#916;lat = lat2&#8722; lat1
+    # &#916;long = long2&#8722; long1
+    # a = sin&#178;(&#916;lat/2) + cos(lat1).cos(lat2).sin&#178;(&#916;long/2)
+    # c = 2.atan2(&#8730;a, &#8730;(1&#8722;a))
+    # d = R.c
+    #
     class Haversine &lt; DistanceFormula
   
       def self.distance(from, to, units = :miles)
-        first_longitude = deg2rad(from.longitude)
-        first_latitude = deg2rad(from.latitude)
-        second_longitude = deg2rad(to.longitude)
-        second_latitude = deg2rad(to.latitude)
+        from_longitude  = deg2rad(from.longitude)
+        from_latitude   = deg2rad(from.latitude)
+        to_longitude    = deg2rad(to.longitude)
+        to_latitude     = deg2rad(to.latitude)
+
+        latitude_delta  = to_latitude - from_latitude
+        longitude_delta = to_longitude - from_longitude
 
-        Math.acos(
-            Math.cos(first_longitude) *
-            Math.cos(second_longitude) * 
-            Math.cos(first_latitude) * 
-            Math.cos(second_latitude) +
+        a = Math.sin(latitude_delta/2)**2 + 
+            Math.cos(from_latitude) * 
+            Math.cos(to_latitude) * 
+            Math.sin(longitude_delta/2)**2
 
-            Math.cos(first_latitude) *
-            Math.sin(first_longitude) *
-            Math.cos(second_latitude) *
-            Math.sin(second_longitude) +
+        c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))
 
-            Math.sin(first_latitude) *
-            Math.sin(second_latitude)
-        ) * EARTH_RADIUS[units.to_sym]
+        d = EARTH_RADIUS[units.to_sym] * c
       end
+
+      # # What formula is this?
+      # def self.distance(from, to, units = :miles)
+      #   from_longitude = deg2rad(from.longitude)
+      #   from_latitude = deg2rad(from.latitude)
+      #   to_longitude = deg2rad(to.longitude)
+      #   to_latitude = deg2rad(to.latitude)
+      # 
+      #   Math.acos(
+      #       Math.cos(from_longitude) *
+      #       Math.cos(to_longitude) * 
+      #       Math.cos(from_latitude) * 
+      #       Math.cos(to_latitude) +
+      # 
+      #       Math.cos(from_latitude) *
+      #       Math.sin(from_longitude) *
+      #       Math.cos(to_latitude) *
+      #       Math.sin(to_longitude) +
+      # 
+      #       Math.sin(from_latitude) *
+      #       Math.sin(to_latitude)
+      #   ) * EARTH_RADIUS[units.to_sym]
+      # end
+   
       
     end
   end</diff>
      <filename>lib/graticule/distance/haversine.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,9 @@ module Graticule
   # Then you create a GoogleGeocode object and start locating addresses:
   # 
   #   require 'rubygems'
-  #   require 'geocode'
+  #   require 'graticule'
   # 
-  #   gg = Geocode.service(:google).new(:key =&gt; MAPS_API_KEY)
+  #   gg = Graticule.service(:google).new(:key =&gt; MAPS_API_KEY)
   #   location = gg.locate '1600 Amphitheater Pkwy, Mountain View, CA'
   #   p location.coordinates
   # 
@@ -21,11 +21,11 @@ module Graticule
       0 =&gt; :unknown,      # Unknown location. (Since 2.59)
       1 =&gt; :country,      # Country level accuracy. (Since 2.59)
       2 =&gt; :state,        # Region (state, province, prefecture, etc.) level accuracy. (Since 2.59)
-      #3 =&gt; :county       # Sub-region (county, municipality, etc.) level accuracy. (Since 2.59)
+      3 =&gt; :state,        # Sub-region (county, municipality, etc.) level accuracy. (Since 2.59)
       4 =&gt; :city,         # Town (city, village) level accuracy. (Since 2.59)
       5 =&gt; :zip,          # Post code (zip code) level accuracy. (Since 2.59)
       6 =&gt; :street,       # Street level accuracy. (Since 2.59)
-      7 =&gt; :intersection, # Intersection level accuracy. (Since 2.59)
+      7 =&gt; :street,       # Intersection level accuracy. (Since 2.59)
       8 =&gt; :address       # Address level accuracy. (Since 2.59)
     }
 
@@ -54,7 +54,7 @@ module Graticule
         :country =&gt; text(xml.elements['/kml/Response/Placemark/AddressDetails/Country/CountryNameCode']),
         :latitude =&gt; latitude,
         :longitude =&gt; longitude,
-        :precision =&gt; PRECISION[xml.elements['/kml/Response/Placemark/AddressDetails'].attribute('Accuracy').value.to_i]
+        :precision =&gt; PRECISION[xml.elements['/kml/Response/Placemark/AddressDetails'].attribute('Accuracy').value.to_i] || :unknown
     end
 
     # Extracts and raises an error from +xml+, if any.</diff>
      <filename>lib/graticule/geocoders/google.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ module Graticule
     end
     
     def distance_to(destination, units = :miles, formula = :haversine)
-      &quot;Distance::#{formula.to_s.titleize}&quot;.constantize.distance(self, destination)
+      &quot;Graticule::Distance::#{formula.to_s.titleize}&quot;.constantize.distance(self, destination)
     end
     
   end</diff>
      <filename>lib/graticule/location.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,11 +6,11 @@ module Graticule
       EARTH_RADIUS_IN_MILES = 3963.1676
       EARTH_RADIUS_IN_KILOMETERS = 6378.135
 
-      FORMULAS = [Haversine]
+      FORMULAS = [Haversine, Spherical, Vincenty]
 
       def test_earth_radius
-        assert_equal EARTH_RADIUS_IN_MILES, DistanceFormula::EARTH_RADIUS[:miles]
-        assert_equal EARTH_RADIUS_IN_KILOMETERS, DistanceFormula::EARTH_RADIUS[:kilometers]
+        assert_equal EARTH_RADIUS_IN_MILES, EARTH_RADIUS[:miles]
+        assert_equal EARTH_RADIUS_IN_KILOMETERS, EARTH_RADIUS[:kilometers]
       end
 
       def test_distance</diff>
      <filename>test/unit/graticule/distance_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,25 @@ module Graticule
       assert_raises(NotImplementedError) { Geocoder.new }
     end
     
-    def test_service
+    def test_bogus_service
       assert_equal BogusGeocoder, Graticule.service(:bogus)
     end
+
+    def test_yahoo_service
+      assert_equal YahooGeocoder, Graticule.service(:yahoo)
+    end
+
+    def test_google_service
+      assert_equal GoogleGeocoder, Graticule.service(:google)
+    end
+
+    def test_geocoder_us_service
+      assert_equal GeocoderUsGeocoder, Graticule.service(:geocoder_us)
+    end
+
+    def test_meta_carta_service
+      assert_equal MetaCartaGeocoder, Graticule.service(:meta_carta)
+    end
   
   end
 end
\ No newline at end of file</diff>
      <filename>test/unit/graticule/geocoder_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
 require File.dirname(__FILE__) + '/../../../test_helper'
 
+
 module Graticule
-  module GeocodersTestCase # &lt; Test::Unit::TestCase
+  
+  # Generic tests for all geocoders (theoretically)
+  module GeocodersTestCase
     
     def test_success
       return unless prepare_response(:success)</diff>
      <filename>test/unit/graticule/geocoders/geocoders.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6587e864adcdf31df412f2b5b91b5e7b879306c1</id>
    </parent>
  </parents>
  <author>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </author>
  <url>http://github.com/collectiveidea/graticule/commit/de1e0403054af08fd90c527427092ce8cc65dfe9</url>
  <id>de1e0403054af08fd90c527427092ce8cc65dfe9</id>
  <committed-date>2006-12-15T20:35:27-08:00</committed-date>
  <authored-date>2006-12-15T20:35:27-08:00</authored-date>
  <message>migrated to hoe
added other distance calculations</message>
  <tree>65eee0323bb2d82c54f787050a18f0e22ef90255</tree>
  <committer>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </committer>
</commit>
