forked from ryanong/mongoid_spacial
-
Couldn't load subscription status.
- Fork 31
Open
Labels
Description
mongoid-geospatial/lib/mongoid/geospatial/wrappers/rgeo.rb
Lines 9 to 18 in 9d25a5a
| module Geospatial | |
| # Wrapper to Rgeo's Point | |
| Point.class_eval do | |
| # | |
| # With RGeo support | |
| # | |
| # @return (RGeo::SphericalFactory::Point) | |
| def to_rgeo | |
| RGeo::Geographic.spherical_factory.point x, y | |
| end |
Here, and everywhere else, the spherical_factory is being used to convert geometries from geospatial Objects into RGeos objects. However, this may not always be the best choice.
The library geo_json already has a solution, that may serve as a guide: