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


140
141
142
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 140

def boundary
  factory.collection([])
end

#coordinatesObject


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

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

#geometry_typeObject


136
137
138
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 136

def geometry_type
  Feature::MultiPoint
end

#initialize(factory, elements) ⇒ Object


126
127
128
129
130
131
132
133
134
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 126

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