Class: GeoRuby::SimpleFeatures::MultiPolygon

Inherits:
Object
  • Object
show all
Defined in:
lib/georuby-ext/georuby/multi_polygon.rb

Instance Method Summary collapse

Instance Method Details

#difference(georuby_multi_polygon) ⇒ Object



14
15
16
17
# File 'lib/georuby-ext/georuby/multi_polygon.rb', line 14

def difference(georuby_multi_polygon)
  multi_polygon_difference = georuby_multi_polygon.present? ? self.to_rgeo.difference(georuby_multi_polygon.to_rgeo) : self.to_rgeo
  multi_polygon_difference.to_georuby
end

#polygonsObject



10
11
12
# File 'lib/georuby-ext/georuby/multi_polygon.rb', line 10

def polygons
  self.geometries
end

#to_googleObject



6
7
8
# File 'lib/georuby-ext/georuby/multi_polygon.rb', line 6

def to_google
  self.class.from_polygons(self.polygons.collect(&:to_google), 900913)
end

#to_rgeoObject



19
20
21
# File 'lib/georuby-ext/georuby/multi_polygon.rb', line 19

def to_rgeo
  rgeo_factory.multi_polygon(polygons.collect(&:to_rgeo))
end

#to_wgs84Object



2
3
4
# File 'lib/georuby-ext/georuby/multi_polygon.rb', line 2

def to_wgs84
  self.class.from_polygons(self.polygons.collect(&:to_wgs84), 4326)
end