I'm new to rgeo but looking to do something that I thought would be a little easier to find! Appreciate the help of the community, in advance. I'm using rails 4.2 and the rgeo gem.
I have a rails model (MyModel) that has a postgis column "point" column called latlon.
I'm looking to find all MyModel records that have a latlon point within a given polygon.
I'm creating a polygon from a linestring without issue like this:
factory = RGeo::Geographic.spherical_factory(:srid => 4326)
a = 
points = params[:polygon]
points.each do |point|
a << factory.point(point,point)
linestring = factory.line_string(a)
poly = factory.polygon(linestring)
What I would now like to get some help with is crafting the query that will find all MyModel instances that have a latlon point within this given polygon.
Thanks in advance!