Class: GeoRuby::SimpleFeatures::MultiPolygon
- Inherits:
-
Object
- Object
- GeoRuby::SimpleFeatures::MultiPolygon
- Defined in:
- lib/georuby-ext/georuby/multi_polygon.rb
Instance Method Summary collapse
- #difference(georuby_multi_polygon) ⇒ Object
- #polygons ⇒ Object
- #to_google ⇒ Object
- #to_rgeo ⇒ Object
- #to_wgs84 ⇒ Object
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 |
#polygons ⇒ Object
10 11 12 |
# File 'lib/georuby-ext/georuby/multi_polygon.rb', line 10 def polygons self.geometries end |
#to_google ⇒ Object
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_rgeo ⇒ Object
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_wgs84 ⇒ Object
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 |