module NoBrainer::GeoQueries::ClassMethods
Public Instance Methods
intersecting(polygon, options)
click to toggle source
# File lib/nobrainer_geospatial.rb, line 115 def intersecting(polygon, options) if polygon.class == Array polygon = RethinkDB::RQL.new.polygon(*polygon) end NoBrainer::GeoResultSet.new(self, self.rql_table.get_intersecting(polygon, options)) end
nearest(point, options)
click to toggle source
# File lib/nobrainer_geospatial.rb, line 107 def nearest(point, options) # if we get an array convert to RQL if point.class == Array point = RethinkDB::RQL.new.point(*point) end NoBrainer::GeoResultSet.new(self, self.rql_table.get_nearest(point, options).map {|result| result['doc'].merge({'_distance' => result['dist']})}) end