-
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
It should be possible to create scopes on ActiveRecord models from the SpatialNamedFunctions. This would be in an optional module a user could include into their ActiveRecord model and it would allow access to these scopes.
This would make the SpatialNamedFunctions more accessible for users that are unfamiliar with Arel.
This would allow you to go from this:
pt = RGeo::Geos.factory.point(1,2)
locations = Location.arel_table
Location.select(:id, :geom).where(locations[:geom].st_contains(pt))to:
pt = RGeo::Geos.factory.point(1,2)
Location.select(:id, :geom).st_contains(:geom, pt)iMacTia, heka1024, BuonOmo and dannote