From a9b9ea0e54f54bdf9fa64827c5a55155a94bf097 Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Tue, 8 Feb 2011 11:23:19 -0500
Subject: [PATCH] Add 'Getting More Information' section to README.

Documents Geocoder.search method.
---
 README.rdoc | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/README.rdoc b/README.rdoc
index 29a71661..5d190d2f 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -143,6 +143,35 @@ However, there can be only one set of latitude/longitude attributes, and whichev
 The reason for this is that we don't want ambiguity when doing distance calculations. We need a single, authoritative source for coordinates!
 
 
+== Getting More Information
+
+Those familiar with Google's Geocoding API know that it returns much more information than just an address or set of coordinates. If you want access to the entire response you can use the <tt>Geocoder.search</tt> method:
+
+  results = Geocoder.search("McCarren Park, Brooklyn, NY")
+  r = results.first
+
++r+ is now a Geocoder::Result object which has methods like the following:
+
+  r.geometry
+   => {
+    "location"=>{"lng"=>-79.3801601, "lat"=>43.6619568},
+    "location_type"=>"ROOFTOP",
+    "viewport"=>{
+      "northeast"=>{"lng"=>-79.3770125, "lat"=>43.6651044},
+      "southwest"=>{"lng"=>-79.3833077, "lat"=>43.6588092}
+    }
+  }
+
+  r.address_components_of_type(:neighborhood)
+   => [{
+    "long_name"=>"Greenpoint",
+    "short_name"=>"Greenpoint",
+    "types"=>["neighborhood", "political"]
+  }]
+
+Please see the Geocoder::Result class for more information, as well as Google's API documentation (http://code.google.com/apis/maps/documentation/geocoding/#JSON).
+
+
 == SQLite
 
 SQLite's lack of trigonometric functions requires an alternate implementation of the +near+ method (scope). When using SQLite, Geocoder will automatically use a less accurate algorithm for finding objects near a given point. Results of this algorithm should not be trusted too much as it will return objects that are outside the given radius.
-- 
GitLab