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


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

def boundary
  factory.collection([])
end

#coordinatesObject


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

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

#geometry_typeObject


142
143
144
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 142

def geometry_type
  Feature::MultiPoint
end

#initialize(factory, elements) ⇒ Object


132
133
134
135
136
137
138
139
140
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 132

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