Class: Mongoid::Geospatial::Line

Inherits:
GeometryField show all
Defined in:
lib/mongoid_geospatial/fields/line.rb,
lib/mongoid_geospatial/wrappers/rgeo.rb,
lib/mongoid_geospatial/wrappers/georuby.rb

Instance Method Summary collapse

Methods inherited from GeometryField

#bounding_box, #center_point, demongoize, #radius, #radius_sphere

Instance Method Details

#to_geoObject



22
23
24
# File 'lib/mongoid_geospatial/wrappers/georuby.rb', line 22

def to_geo
  GeoRuby::SimpleFeatures::LineString.from_coordinates(self)
end

#to_rgeoObject



28
29
30
# File 'lib/mongoid_geospatial/wrappers/rgeo.rb', line 28

def to_rgeo
  RGeo::Geographic.spherical_factory.line_string points
end