Module: RGeo::Geos::ZMGeometryMethods
- Includes:
- Feature::Instance
- Included in:
- ZMGeometryCollectionImpl, ZMGeometryImpl, ZMLineImpl, ZMLineStringImpl, ZMLinearRingImpl, ZMMultiLineStringImpl, ZMMultiPointImpl, ZMMultiPolygonImpl, ZMPointImpl, ZMPolygonImpl
- Defined in:
- lib/rgeo/geos/zm_feature_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
- #as_binary ⇒ Object
- #as_text ⇒ Object
- #boundary ⇒ Object
- #buffer(distance_) ⇒ Object
- #contains?(rhs) ⇒ Boolean
- #convex_hull ⇒ Object
- #coordinate_dimension ⇒ Object
- #crosses?(rhs) ⇒ Boolean
- #difference(rhs) ⇒ Object (also: #-)
- #dimension ⇒ Object
- #disjoint?(rhs) ⇒ Boolean
- #distance(rhs) ⇒ Object
- #empty? ⇒ Boolean
-
#encode_with(coder) ⇒ Object
:nodoc:.
- #envelope ⇒ Object
- #equals?(rhs) ⇒ Boolean (also: #==)
- #factory ⇒ Object
- #geometry_type ⇒ Object
- #hash ⇒ Object
-
#init_with(coder) ⇒ Object
:nodoc:.
- #initialize(factory, zgeometry, mgeometry) ⇒ Object
-
#inspect ⇒ Object
:nodoc:.
- #intersection(rhs) ⇒ Object (also: #*)
- #intersects?(rhs) ⇒ Boolean
- #is_3d? ⇒ Boolean
- #m_geometry ⇒ Object
-
#marshal_dump ⇒ Object
:nodoc:.
-
#marshal_load(data) ⇒ Object
:nodoc:.
- #measured? ⇒ Boolean
- #overlaps?(rhs) ⇒ Boolean
- #relate?(rhs, pattern) ⇒ Boolean
- #rep_equals?(rhs) ⇒ Boolean (also: #eql?)
- #simple? ⇒ Boolean
- #spatial_dimension ⇒ Object
- #srid ⇒ Object
- #sym_difference(rhs) ⇒ Object
-
#to_s ⇒ Object
:nodoc:.
- #touches?(rhs) ⇒ Boolean
- #union(rhs) ⇒ Object (also: #+)
- #within?(rhs) ⇒ Boolean
- #z_geometry ⇒ Object
Instance Method Details
#as_binary ⇒ Object
72 73 74 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 72 def as_binary @factory.instance_variable_get(:@wkb_generator).generate(self) end |
#as_text ⇒ Object
68 69 70 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 68 def as_text @factory.instance_variable_get(:@wkt_generator).generate(self) end |
#boundary ⇒ Object
92 93 94 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 92 def boundary @factory.create_feature(nil, @zgeometry.boundary, @mgeometry.boundary) end |
#buffer(distance_) ⇒ Object
136 137 138 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 136 def buffer(distance_) @factory.create_feature(nil, @zgeometry.buffer(distance_), @mgeometry.buffer(distance_)) end |
#contains?(rhs) ⇒ Boolean
120 121 122 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 120 def contains?(rhs) @zgeometry.contains?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#convex_hull ⇒ Object
140 141 142 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 140 def convex_hull @factory.create_feature(nil, @zgeometry.convex_hull, @mgeometry.convex_hull) end |
#coordinate_dimension ⇒ Object
48 49 50 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 48 def coordinate_dimension 4 end |
#crosses?(rhs) ⇒ Boolean
112 113 114 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 112 def crosses?(rhs) @zgeometry.crosses?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#difference(rhs) ⇒ Object Also known as: -
154 155 156 157 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 154 def difference(rhs) rhs = RGeo::Feature.cast(rhs, self) @factory.create_feature(nil, @zgeometry.difference(rhs.z_geometry), @mgeometry.difference(rhs.m_geometry)) end |
#dimension ⇒ Object
44 45 46 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 44 def dimension @zgeometry.dimension end |
#disjoint?(rhs) ⇒ Boolean
100 101 102 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 100 def disjoint?(rhs) @zgeometry.disjoint?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#distance(rhs) ⇒ Object
132 133 134 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 132 def distance(rhs) @zgeometry.distance(RGeo::Feature.cast(rhs, self).z_geometry) end |
#empty? ⇒ Boolean
76 77 78 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 76 def empty? @zgeometry.empty? end |
#encode_with(coder) ⇒ Object
:nodoc:
191 192 193 194 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 191 def encode_with(coder) # :nodoc: coder["factory"] = @factory coder["wkt"] = @factory.psych_wkt_generator.generate(self) end |
#envelope ⇒ Object
64 65 66 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 64 def envelope @factory.create_feature(nil, @zgeometry.envelope, @mgeometry.envelope) end |
#equals?(rhs) ⇒ Boolean Also known as: ==
96 97 98 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 96 def equals?(rhs) @zgeometry.equals?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#factory ⇒ Object
32 33 34 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 32 def factory @factory end |
#geometry_type ⇒ Object
56 57 58 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 56 def geometry_type @zgeometry.geometry_type end |
#hash ⇒ Object
28 29 30 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 28 def hash [@factory, @zgeometry, @mgeometry].hash end |
#init_with(coder) ⇒ Object
:nodoc:
196 197 198 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 196 def init_with(coder) # :nodoc: copy_state_from(coder["factory"].psych_wkt_parser.parse(coder["wkt"])) end |
#initialize(factory, zgeometry, mgeometry) ⇒ Object
14 15 16 17 18 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 14 def initialize(factory, zgeometry, mgeometry) @factory = factory @zgeometry = zgeometry @mgeometry = mgeometry end |
#inspect ⇒ Object
:nodoc:
20 21 22 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 20 def inspect # :nodoc: "#<#{self.class}:0x#{object_id.to_s(16)} #{as_text.inspect}>" end |
#intersection(rhs) ⇒ Object Also known as: *
144 145 146 147 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 144 def intersection(rhs) rhs = RGeo::Feature.cast(rhs, self) @factory.create_feature(nil, @zgeometry.intersection(rhs.z_geometry), @mgeometry.intersection(rhs.m_geometry)) end |
#intersects?(rhs) ⇒ Boolean
104 105 106 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 104 def intersects?(rhs) @zgeometry.intersects?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#is_3d? ⇒ Boolean
84 85 86 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 84 def is_3d? true end |
#m_geometry ⇒ Object
40 41 42 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 40 def m_geometry @mgeometry end |
#marshal_dump ⇒ Object
:nodoc:
183 184 185 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 183 def marshal_dump # :nodoc: [@factory, @factory.marshal_wkb_generator.generate(self)] end |
#marshal_load(data) ⇒ Object
:nodoc:
187 188 189 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 187 def marshal_load(data) # :nodoc: copy_state_from(data[0].marshal_wkb_parser.parse(data[1])) end |
#measured? ⇒ Boolean
88 89 90 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 88 def measured? true end |
#overlaps?(rhs) ⇒ Boolean
124 125 126 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 124 def overlaps?(rhs) @zgeometry.overlaps?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#relate?(rhs, pattern) ⇒ Boolean
128 129 130 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 128 def relate?(rhs, pattern) @zgeometry.relate?(RGeo::Feature.cast(rhs, self).z_geometry, pattern) end |
#rep_equals?(rhs) ⇒ Boolean Also known as: eql?
168 169 170 171 172 173 174 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 168 def rep_equals?(rhs) rhs = RGeo::Feature.cast(rhs, self) rhs.is_a?(self.class) && @factory.eql?(rhs.factory) && @zgeometry.rep_equals?(rhs.z_geometry) && @mgeometry.rep_equals?(rhs.m_geometry) end |
#simple? ⇒ Boolean
80 81 82 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 80 def simple? @zgeometry.simple? end |
#spatial_dimension ⇒ Object
52 53 54 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 52 def spatial_dimension 3 end |
#srid ⇒ Object
60 61 62 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 60 def srid @factory.srid end |
#sym_difference(rhs) ⇒ Object
159 160 161 162 163 164 165 166 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 159 def sym_difference(rhs) rhs = RGeo::Feature.cast(rhs, self) @factory.create_feature( nil, @zgeometry.sym_difference(rhs.z_geometry), @mgeometry.sym_difference(rhs.m_geometry) ) end |
#to_s ⇒ Object
:nodoc:
24 25 26 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 24 def to_s # :nodoc: as_text end |
#touches?(rhs) ⇒ Boolean
108 109 110 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 108 def touches?(rhs) @zgeometry.touches?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#union(rhs) ⇒ Object Also known as: +
149 150 151 152 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 149 def union(rhs) rhs = RGeo::Feature.cast(rhs, self) @factory.create_feature(nil, @zgeometry.union(rhs.z_geometry), @mgeometry.union(rhs.m_geometry)) end |
#within?(rhs) ⇒ Boolean
116 117 118 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 116 def within?(rhs) @zgeometry.within?(RGeo::Feature.cast(rhs, self).z_geometry) end |
#z_geometry ⇒ Object
36 37 38 |
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 36 def z_geometry @zgeometry end |