Module: RGeo::Geos::ZMGeometryMethods

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#_copy_state_from(obj_) ⇒ Object

:nodoc:


227
228
229
230
231
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 227

def _copy_state_from(obj_)  # :nodoc:
  @factory = obj_.factory
  @zgeometry = obj_.z_geometry
  @mgeometry = obj_.m_geometry
end

#as_binaryObject


108
109
110
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 108

def as_binary
  @factory.instance_variable_get(:@wkb_generator).generate(self)
end

#as_textObject


103
104
105
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 103

def as_text
  @factory.instance_variable_get(:@wkt_generator).generate(self)
end

#boundaryObject


123
124
125
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 123

def boundary
  @factory._create_feature(nil, @zgeometry.boundary, @mgeometry.boundary)
end

#buffer(distance_) ⇒ Object


179
180
181
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 179

def buffer(distance_)
  @factory._create_feature(nil, @zgeometry.buffer(distance_), @mgeometry.buffer(distance_))
end

#contains?(rhs_) ⇒ Boolean

Returns:

  • (Boolean)

158
159
160
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 158

def contains?(rhs_)
  @zgeometry.contains?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#convex_hullObject


184
185
186
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 184

def convex_hull
  @factory._create_feature(nil, @zgeometry.convex_hull, @mgeometry.convex_hull)
end

#crosses?(rhs_) ⇒ Boolean

Returns:

  • (Boolean)

148
149
150
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 148

def crosses?(rhs_)
  @zgeometry.crosses?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#difference(rhs_) ⇒ Object Also known as: -


201
202
203
204
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 201

def difference(rhs_)
  rhs_ = ::RGeo::Feature.cast(rhs_, self)
  @factory._create_feature(nil, @zgeometry.difference(rhs_.z_geometry), @mgeometry.difference(rhs_.m_geometry))
end

#dimensionObject


83
84
85
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 83

def dimension
  @zgeometry.dimension
end

#disjoint?(rhs_) ⇒ Boolean

Returns:

  • (Boolean)

133
134
135
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 133

def disjoint?(rhs_)
  @zgeometry.disjoint?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#distance(rhs_) ⇒ Object


174
175
176
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 174

def distance(rhs_)
  @zgeometry.distance(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#encode_with(coder_) ⇒ Object

:nodoc:


243
244
245
246
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 243

def encode_with(coder_)  # :nodoc:
  coder_['factory'] = @factory
  coder_['wkt'] = @factory._psych_wkt_generator.generate(self)
end

#envelopeObject


98
99
100
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 98

def envelope
  @factory._create_feature(nil, @zgeometry.envelope, @mgeometry.envelope)
end

#equals?(rhs_) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)

128
129
130
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 128

def equals?(rhs_)
  @zgeometry.equals?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#factoryObject


68
69
70
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 68

def factory
  @factory
end

#geometry_typeObject


88
89
90
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 88

def geometry_type
  @zgeometry.geometry_type
end

#hashObject


63
64
65
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 63

def hash
  @factory.hash ^ @zgeometry.hash ^ @mgeometry.hash
end

#init_with(coder_) ⇒ Object

:nodoc:


248
249
250
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 248

def init_with(coder_)  # :nodoc:
  _copy_state_from(coder_['factory']._psych_wkt_parser.parse(coder_['wkt']))
end

#initialize(factory_, zgeometry_, mgeometry_) ⇒ Object


47
48
49
50
51
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 47

def initialize(factory_, zgeometry_, mgeometry_)
  @factory = factory_
  @zgeometry = zgeometry_
  @mgeometry = mgeometry_
end

#inspectObject

:nodoc:


54
55
56
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 54

def inspect  # :nodoc:
  "#<#{self.class}:0x#{object_id.to_s(16)} #{as_text.inspect}>"
end

#intersection(rhs_) ⇒ Object Also known as: *


189
190
191
192
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 189

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

Returns:

  • (Boolean)

138
139
140
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 138

def intersects?(rhs_)
  @zgeometry.intersects?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#is_empty?Boolean

Returns:

  • (Boolean)

113
114
115
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 113

def is_empty?
  @zgeometry.is_empty?
end

#is_simple?Boolean

Returns:

  • (Boolean)

118
119
120
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 118

def is_simple?
  @zgeometry.is_simple?
end

#m_geometryObject


78
79
80
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 78

def m_geometry
  @mgeometry
end

#marshal_dumpObject

:nodoc:


234
235
236
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 234

def marshal_dump  # :nodoc:
  [@factory, @factory._marshal_wkb_generator.generate(self)]
end

#marshal_load(data_) ⇒ Object

:nodoc:


238
239
240
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 238

def marshal_load(data_)  # :nodoc:
  _copy_state_from(data_[0]._marshal_wkb_parser.parse(data_[1]))
end

#overlaps?(rhs_) ⇒ Boolean

Returns:

  • (Boolean)

163
164
165
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 163

def overlaps?(rhs_)
  @zgeometry.overlaps?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#relate?(rhs_, pattern_) ⇒ Boolean Also known as: relate

Returns:

  • (Boolean)

168
169
170
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 168

def relate?(rhs_, pattern_)
  @zgeometry.relate?(::RGeo::Feature.cast(rhs_, self).z_geometry, pattern_)
end

#rep_equals?(rhs_) ⇒ Boolean Also known as: eql?

Returns:

  • (Boolean)

213
214
215
216
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 213

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

#sridObject


93
94
95
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 93

def srid
  @factory.srid
end

#sym_difference(rhs_) ⇒ Object


207
208
209
210
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 207

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_sObject

:nodoc:


58
59
60
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 58

def to_s  # :nodoc:
  as_text
end

#touches?(rhs_) ⇒ Boolean

Returns:

  • (Boolean)

143
144
145
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 143

def touches?(rhs_)
  @zgeometry.touches?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#union(rhs_) ⇒ Object Also known as: +


195
196
197
198
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 195

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

Returns:

  • (Boolean)

153
154
155
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 153

def within?(rhs_)
  @zgeometry.within?(::RGeo::Feature.cast(rhs_, self).z_geometry)
end

#z_geometryObject


73
74
75
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 73

def z_geometry
  @zgeometry
end