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 Method Summary collapse
-
#_copy_state_from(obj_) ⇒ Object
:nodoc:.
-
#_set_factory(factory_) ⇒ Object
:nodoc:.
-
#_validate_geometry ⇒ Object
:nodoc:.
- #as_binary ⇒ Object
- #as_text ⇒ Object
-
#encode_with(coder_) ⇒ Object
:nodoc:.
- #factory ⇒ Object
-
#init_with(coder_) ⇒ Object
:nodoc:.
-
#inspect ⇒ Object
:nodoc:.
-
#marshal_dump ⇒ Object
:nodoc:.
-
#marshal_load(data_) ⇒ Object
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Instance Method Details
#_copy_state_from(obj_) ⇒ Object
:nodoc:
39 40 41 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 39 def _copy_state_from(obj_) # :nodoc: @factory = obj_.factory end |
#_set_factory(factory_) ⇒ Object
:nodoc:
23 24 25 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 23 def _set_factory(factory_) # :nodoc: @factory = factory_ end |
#_validate_geometry ⇒ Object
:nodoc:
20 21 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 20 def _validate_geometry # :nodoc: end |
#as_binary ⇒ Object
35 36 37 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 35 def as_binary @factory._generate_wkb(self) end |
#as_text ⇒ Object
31 32 33 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 31 def as_text @factory._generate_wkt(self) end |
#encode_with(coder_) ⇒ Object
:nodoc:
51 52 53 54 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 51 def encode_with(coder_) # :nodoc: coder_["factory"] = @factory coder_["wkt"] = @factory._psych_wkt_generator.generate(self) end |
#factory ⇒ Object
27 28 29 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 27 def factory @factory end |
#init_with(coder_) ⇒ Object
:nodoc:
56 57 58 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 56 def init_with(coder_) # :nodoc: _copy_state_from(coder_["factory"]._psych_wkt_parser.parse(coder_["wkt"])) end |
#inspect ⇒ Object
:nodoc:
12 13 14 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 12 def inspect # :nodoc: "#<#{self.class}:0x#{object_id.to_s(16)} #{as_text.inspect}>" end |
#marshal_dump ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 43 def marshal_dump # :nodoc: [@factory, @factory._marshal_wkb_generator.generate(self)] end |
#marshal_load(data_) ⇒ Object
:nodoc:
47 48 49 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 47 def marshal_load(data_) # :nodoc: _copy_state_from(data_[0]._marshal_wkb_parser.parse(data_[1])) end |
#to_s ⇒ Object
:nodoc:
16 17 18 |
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 16 def to_s # :nodoc: as_text end |