Class: Mongoid::Geospatial::Line

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

Overview

Wrapper to GeoRuby’s Line

Instance Method Summary collapse

Methods inherited from GeometryField

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

Instance Method Details

#to_geoObject



21
22
23
# File 'lib/mongoid/geospatial/wrappers/georuby.rb', line 21

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

#to_rgeoObject



30
31
32
# File 'lib/mongoid/geospatial/wrappers/rgeo.rb', line 30

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