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


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

def boundary
  factory.collection([])
end

#coordinatesObject


156
157
158
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 156

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

#geometry_typeObject


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

def geometry_type
  Feature::MultiPoint
end

#initialize(factory, elements) ⇒ Object


138
139
140
141
142
143
144
145
146
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 138

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