Module: RGeo::ImplHelper::BasicMultiPointMethods

Included in:
Cartesian::MultiPointImpl, Geographic::ProjectedMultiPointImpl, Geographic::SphericalMultiPointImpl
Defined in:
lib/rgeo/impl_helper/basic_geometry_collection_methods.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#boundaryObject



149
150
151
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 149

def boundary
  factory.collection([])
end

#coordinatesObject



153
154
155
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 153

def coordinates
  @elements.map(&:coordinates)
end

#geometry_typeObject



145
146
147
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 145

def geometry_type
  Feature::MultiPoint
end

#initialize(factory, elements) ⇒ Object



135
136
137
138
139
140
141
142
143
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 135

def initialize(factory, elements)
  self.factory = factory
  @elements = elements.map do |elem|
    elem = Feature.cast(elem, factory, Feature::Point, :keep_subtype)
    raise Error::InvalidGeometry, "Could not cast #{elem}" unless elem
    elem
  end
  init_geometry
end