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


162
163
164
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 162

def boundary
  factory.collection([])
end

#coordinatesObject


166
167
168
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 166

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

#geometry_typeObject


158
159
160
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 158

def geometry_type
  Feature::MultiPoint
end

#initialize(factory, elements) ⇒ Object


148
149
150
151
152
153
154
155
156
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 148

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
  validate_geometry
end