Class: GeoRuby::SimpleFeatures::MultiPolygon
- Inherits:
-
Object
- Object
- GeoRuby::SimpleFeatures::MultiPolygon
- Defined in:
- lib/geo_ruby/simple_features.rb
Instance Method Summary collapse
-
#contains_point?(point) ⇒ Boolean
True if any of the Polygon’s shapes contain this point.
-
#to_array ⇒ Array
A shortcut for grabbing an array of coordinates from GeoRuby’s MultiPolygon.
Instance Method Details
#contains_point?(point) ⇒ Boolean
Returns true if any of the Polygon’s shapes contain this point.
20 21 22 23 24 25 26 |
# File 'lib/geo_ruby/simple_features.rb', line 20 def contains_point?(point) self.each do |shape| return true if shape.contains_point?(point) end return false end |
#to_array ⇒ Array
A shortcut for grabbing an array of coordinates from GeoRuby’s MultiPolygon.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/geo_ruby/simple_features.rb', line 7 def to_array coord_array = self.as_json[:coordinates] ## Fixes weird, unnecessary extra array 0.upto(coord_array.count - 1).each do |i| coord_array[i] = coord_array[i][0] end return coord_array end |