Module: RGeo::Geos::FFIGeometryMethods

Defined in:
lib/georuby-ext/rgeo/geos/ffi_feature_methods.rb

Instance Method Summary collapse

Instance Method Details

#to_geometryObject



25
26
27
# File 'lib/georuby-ext/rgeo/geos/ffi_feature_methods.rb', line 25

def to_geometry
  self
end

#to_georubyObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/georuby-ext/rgeo/geos/ffi_feature_methods.rb', line 10

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