Module: RGeo::ImplHelper::BasicGeometryMethods
- Includes:
- Feature::Instance
- Included in:
- Cartesian::GeometryCollectionImpl, Cartesian::LineImpl, Cartesian::LineStringImpl, Cartesian::LinearRingImpl, Cartesian::MultiLineStringImpl, Cartesian::MultiPointImpl, Cartesian::MultiPolygonImpl, Cartesian::PointImpl, Cartesian::PolygonImpl, Geographic::ProjectedGeometryCollectionImpl, Geographic::ProjectedLineImpl, Geographic::ProjectedLineStringImpl, Geographic::ProjectedLinearRingImpl, Geographic::ProjectedMultiLineStringImpl, Geographic::ProjectedMultiPointImpl, Geographic::ProjectedMultiPolygonImpl, Geographic::ProjectedPointImpl, Geographic::ProjectedPolygonImpl, Geographic::SphericalGeometryCollectionImpl, Geographic::SphericalLineImpl, Geographic::SphericalLineStringImpl, Geographic::SphericalLinearRingImpl, Geographic::SphericalMultiLineStringImpl, Geographic::SphericalMultiPointImpl, Geographic::SphericalMultiPolygonImpl, Geographic::SphericalPointImpl, Geographic::SphericalPolygonImpl
- Defined in:
- lib/rgeo/impl_helper/basic_geometry_methods.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#factory ⇒ Object
Returns the value of attribute factory.
Instance Method Summary collapse
- #as_binary ⇒ Object
- #as_text ⇒ Object
-
#encode_with(coder) ⇒ Object
:nodoc:.
-
#init_with(coder) ⇒ Object
:nodoc:.
-
#inspect ⇒ Object
:nodoc:.
-
#marshal_dump ⇒ Object
:nodoc:.
-
#marshal_load(data) ⇒ Object
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Instance Attribute Details
#factory ⇒ Object
Returns the value of attribute factory.
14 15 16 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 14 def factory @factory end |
Instance Method Details
#as_binary ⇒ Object
28 29 30 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 28 def as_binary @factory.generate_wkb(self) end |
#as_text ⇒ Object
24 25 26 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 24 def as_text @factory.generate_wkt(self) end |
#encode_with(coder) ⇒ Object
:nodoc:
40 41 42 43 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 40 def encode_with(coder) # :nodoc: coder["factory"] = @factory coder["wkt"] = @factory.psych_wkt_generator.generate(self) end |
#init_with(coder) ⇒ Object
:nodoc:
45 46 47 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 45 def init_with(coder) # :nodoc: copy_state_from(coder["factory"].psych_wkt_parser.parse(coder["wkt"])) end |
#inspect ⇒ Object
:nodoc:
16 17 18 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 16 def inspect # :nodoc: "#<#{self.class}:0x#{object_id.to_s(16)} #{as_text.inspect}>" end |
#marshal_dump ⇒ Object
:nodoc:
32 33 34 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 32 def marshal_dump # :nodoc: [@factory, @factory.marshal_wkb_generator.generate(self)] end |
#marshal_load(data) ⇒ Object
:nodoc:
36 37 38 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 36 def marshal_load(data) # :nodoc: copy_state_from(data[0].marshal_wkb_parser.parse(data[1])) end |
#to_s ⇒ Object
:nodoc:
20 21 22 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 20 def to_s # :nodoc: as_text end |