Sha256: 20fc1f3b26b3e1688a6c331bd433dfb6d45f49e6cebf155eb008d87e56415807

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

require 'georuby'
# require 'mongoid_geospatial/extensions/georuby'

module Mongoid
  module Geospatial

    class Point
      def to_geo
        GeoRuby::SimpleFeatures::Point.from_x_y(x, y)
      end
    end


    class LineString < Array
      def to_geo
        GeoRuby::SimpleFeatures::LineString.from_array(self)
      end

    end

    class Polygon < GeometryField
      def to_geo
        GeoRuby::SimpleFeatures::Polygon.from_array(self)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid_geospatial-2.2.0 lib/mongoid_geospatial/wrappers/georuby.rb