Module: RGeo::Cartesian::GeometryMethods

Defined in:
lib/georuby-ext/rgeo/cartesian/feature_methods.rb

Instance Method Summary collapse

Instance Method Details

#to_georubyObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/georuby-ext/rgeo/cartesian/feature_methods.rb', line 5

def to_georuby
  if self.class == PointImpl
    GeoRuby::SimpleFeatures::Point.from_x_y x, y, srid
  elsif self.class == LineStringImpl
    GeoRuby::SimpleFeatures::LineString.from_points points.collect(&:to_georuby), srid     
  elsif self.class == LinearRingImpl
    GeoRuby::SimpleFeatures::LinearRing.from_points points.collect(&:to_georuby), srid
  elsif self.class == PolygonImpl
    GeoRuby::SimpleFeatures::Polygon.from_linear_rings linear_rings.collect(&:to_georuby), srid
  else
    GeoRuby::SimpleFeatures::Geometry.from_geometry collect(&:to_georuby), srid
  end      
  
end