Method: RGeo::ImplHelper::BasicMultiLineStringMethods#boundary

Defined in:
lib/rgeo/impl_helper/basic_geometry_collection_methods.rb

#boundaryObject


101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 101

def boundary
  hash = {}
  @elements.each do |line|
    if !line.empty? && !line.closed?
      add_boundary(hash, line.start_point)
      add_boundary(hash, line.end_point)
    end
  end
  array = []
  hash.each do |_hval, data_|
    array << data_[0] if data_[1].odd?
  end
  factory.multipoint([array])
end