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



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

def boundary
  factory.collection([])
end

#coordinatesObject



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

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

#geometry_typeObject



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

def geometry_type
  Feature::MultiPoint
end

#initialize(factory_, elements_) ⇒ Object



129
130
131
132
133
134
135
136
137
# File 'lib/rgeo/impl_helper/basic_geometry_collection_methods.rb', line 129

def initialize(factory_, elements_)
  _set_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