Skip to content
Snippets Groups Projects
Commit 2c0d0e78 authored by Alex Reisner's avatar Alex Reisner
Browse files

Merge pull request #468 from aripollak/patch-1

Update README to reflect bounding box optimization
parents 95ad41db ebbc9695
No related branches found
No related tags found
No related merge requests found
......@@ -223,9 +223,7 @@ When querying for objects (if you're using ActiveRecord) you can also look withi
box = Geocoder::Calculations.bounding_box(center_point, distance)
Venue.within_bounding_box(box)
This can also dramatically improve query performance, especially when used in conjunction with indexes on the latitude/longitude columns. Note, however, that returned results do not include `distance` and `bearing` attributes. If you want to improve performance AND have access to distance and bearing info, use both scopes:
Venue.near(center_point, distance).within_bounding_box(box)
This can also dramatically improve query performance, especially when used in conjunction with indexes on the latitude/longitude columns. Note, however, that returned results do not include `distance` and `bearing` attributes. Note that `#near` performs both bounding box and radius queries for speed.
Advanced Geocoding
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment