Class: Charta::Factory::SimpleGeometryFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/charta/factory/simple_geometry_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feature_factory:) ⇒ SimpleGeometryFactory

Returns a new instance of SimpleGeometryFactory.

Parameters:



10
11
12
# File 'lib/charta/factory/simple_geometry_factory.rb', line 10

def initialize(feature_factory:)
  @feature_factory = feature_factory
end

Instance Attribute Details

#feature_factorySimpleFeatureFactory (readonly)



7
8
9
# File 'lib/charta/factory/simple_geometry_factory.rb', line 7

def feature_factory
  @feature_factory
end

Instance Method Details

#empty_geometry(srs) ⇒ Object



22
23
24
# File 'lib/charta/factory/simple_geometry_factory.rb', line 22

def empty_geometry(srs)
  wrap(feature_factory.empty_feature(srs))
end

#new_geometry(coordinates, srs: nil, format: nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/charta/factory/simple_geometry_factory.rb', line 14

def new_geometry(coordinates, srs: nil, format: nil)
  if coordinates.is_a?(::Charta::Geometry)
    coordinates
  else
    wrap(feature_factory.new_feature(coordinates, srs: srs, format: format))
  end
end