Class: Charta::Factory::SimpleGeometryFactory
- Inherits:
-
Object
- Object
- Charta::Factory::SimpleGeometryFactory
- Defined in:
- lib/charta/factory/simple_geometry_factory.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #empty_geometry(srs) ⇒ Object
-
#initialize(feature_factory:) ⇒ SimpleGeometryFactory
constructor
A new instance of SimpleGeometryFactory.
- #new_geometry(coordinates, srs: nil, format: nil) ⇒ Object
Constructor Details
#initialize(feature_factory:) ⇒ SimpleGeometryFactory
Returns a new instance of SimpleGeometryFactory.
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_factory ⇒ SimpleFeatureFactory (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 |