picky
https://github.com/floere/picky
HTML
Picky is an easy to use and fast Ruby semantic search engine that helps your users find what they are looking for.
Picky::Index#geo_categories
Geo search, searches in a rectangle (almost square) in the lat/long coordinate system. Note: It uses #ranged_category. Parameters: * lat_name: The latitude's name as used in #category. * lng_name: The longitude's name as used in #category. * radius: The distance (in km) around the query point which we search for results. Note: Picky uses a square, not a circle. That should be ok for most usages. ----------------------------- | | | | | | | | | | | *<- radius ->| | | | | | | | | | | ----------------------------- Options * precision: Default 1 (20% error margin, very fast), up to 5 (5% error margin, slower) makes sense. * lat_from: The data category to take the data for the latitude from. * lng_from: The data category to take the data for the longitude from. THINK Will have to write a wrapper that combines two categories that are indexed simultaneously, since lat/lng are correlated.
Edit
git clone [email protected]:floere/picky.git
cd picky
open server/lib/picky/index.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Picky--Index-geo_categories-for-pr
# Commit to gitgit add server/lib/picky/index.rbgit commit -m "better docs for Picky::Index#geo_categories"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Picky--Index-geo_categories-for-pr
hub pull-request
# Celebrate!