Class: RGeo::Geos::ZMGeometryImpl
- Inherits:
-
Object
- Object
- RGeo::Geos::ZMGeometryImpl
show all
- Includes:
- Feature::Instance
- Defined in:
- lib/rgeo/geos/zm_impl.rb,
lib/rgeo/geos/zm_impl.rb
Overview
Constant Summary
collapse
- TYPE_KLASSES =
{
Feature::Point => ZMPointImpl,
Feature::LineString => ZMLineStringImpl,
Feature::Line => ZMLineStringImpl,
Feature::LinearRing => ZMLineStringImpl,
Feature::Polygon => ZMPolygonImpl,
Feature::GeometryCollection => ZMGeometryCollectionImpl,
Feature::MultiPoint => ZMGeometryCollectionImpl,
Feature::MultiLineString => ZMMultiLineStringImpl,
Feature::MultiPolygon => ZMMultiPolygonImpl,
}
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(factory_, zgeometry_, mgeometry_) ⇒ ZMGeometryImpl
Returns a new instance of ZMGeometryImpl.
47
48
49
50
51
|
# File 'lib/rgeo/geos/zm_impl.rb', line 47
def initialize(factory_, zgeometry_, mgeometry_)
@factory = factory_
@zgeometry = zgeometry_
@mgeometry = mgeometry_
end
|
Class Method Details
.create(factory_, zgeometry_, mgeometry_) ⇒ Object
421
422
423
424
|
# File 'lib/rgeo/geos/zm_impl.rb', line 421
def self.create(factory_, zgeometry_, mgeometry_)
klass_ = self == ZMGeometryImpl ? TYPE_KLASSES[zgeometry_.geometry_type] : self
klass_ && zgeometry_ && mgeometry_ ? klass_.new(factory_, zgeometry_, mgeometry_) : nil
end
|
Instance Method Details
#boundary ⇒ Object
123
124
125
|
# File 'lib/rgeo/geos/zm_impl.rb', line 123
def boundary
ZMGeometryImpl.create(@factory, @zgeometry.boundary, @mgeometry.boundary)
end
|
#buffer(distance_) ⇒ Object
178
179
180
|
# File 'lib/rgeo/geos/zm_impl.rb', line 178
def buffer(distance_)
ZMGeometryImpl.create(@factory, @zgeometry.buffer(distance_), @mgeometry.buffer(distance_))
end
|
#contains?(rhs_) ⇒ Boolean
158
159
160
|
# File 'lib/rgeo/geos/zm_impl.rb', line 158
def contains?(rhs_)
@zgeometry.contains?(rhs_)
end
|
#convex_hull ⇒ Object
183
184
185
|
# File 'lib/rgeo/geos/zm_impl.rb', line 183
def convex_hull
ZMGeometryImpl.create(@factory, @zgeometry.convex_hull, @mgeometry.convex_hull)
end
|
#crosses?(rhs_) ⇒ Boolean
148
149
150
|
# File 'lib/rgeo/geos/zm_impl.rb', line 148
def crosses?(rhs_)
@zgeometry.crosses?(rhs_)
end
|
#difference(rhs_) ⇒ Object
Also known as:
-
198
199
200
|
# File 'lib/rgeo/geos/zm_impl.rb', line 198
def difference(rhs_)
ZMGeometryImpl.create(@factory, @zgeometry.difference(rhs_), @mgeometry.difference(rhs_))
end
|
#dimension ⇒ Object
83
84
85
|
# File 'lib/rgeo/geos/zm_impl.rb', line 83
def dimension
@zgeometry.dimension
end
|
#disjoint?(rhs_) ⇒ Boolean
133
134
135
|
# File 'lib/rgeo/geos/zm_impl.rb', line 133
def disjoint?(rhs_)
@zgeometry.disjoint?(rhs_)
end
|
#distance(rhs_) ⇒ Object
173
174
175
|
# File 'lib/rgeo/geos/zm_impl.rb', line 173
def distance(rhs_)
@zgeometry.distance(rhs_)
end
|
#envelope ⇒ Object
98
99
100
|
# File 'lib/rgeo/geos/zm_impl.rb', line 98
def envelope
ZMGeometryImpl.create(@factory, @zgeometry.envelope, @mgeometry.envelope)
end
|
#eql?(rhs_) ⇒ Boolean
78
79
80
|
# File 'lib/rgeo/geos/zm_impl.rb', line 78
def eql?(rhs_)
rhs_.is_a?(self.class) && @factory.eql?(rhs_.factory) && @zgeometry.eql?(rhs_.z_geometry) && @mgeometry.eql?(rhs_.m_geometry)
end
|
#equals?(rhs_) ⇒ Boolean
Also known as:
==
128
129
130
|
# File 'lib/rgeo/geos/zm_impl.rb', line 128
def equals?(rhs_)
@zgeometry.equals?(rhs_)
end
|
#factory ⇒ Object
63
64
65
|
# File 'lib/rgeo/geos/zm_impl.rb', line 63
def factory
@factory
end
|
#geometry_type ⇒ Object
88
89
90
|
# File 'lib/rgeo/geos/zm_impl.rb', line 88
def geometry_type
@zgeometry.geometry_type
end
|
#inspect ⇒ Object
54
55
56
|
# File 'lib/rgeo/geos/zm_impl.rb', line 54
def inspect "#<#{self.class}:0x#{object_id.to_s(16)} #{as_text.inspect}>"
end
|
#intersection(rhs_) ⇒ Object
Also known as:
*
188
189
190
|
# File 'lib/rgeo/geos/zm_impl.rb', line 188
def intersection(rhs_)
ZMGeometryImpl.create(@factory, @zgeometry.intersection(rhs_), @mgeometry.intersection(rhs_))
end
|
#intersects?(rhs_) ⇒ Boolean
138
139
140
|
# File 'lib/rgeo/geos/zm_impl.rb', line 138
def intersects?(rhs_)
@zgeometry.intersects?(rhs_)
end
|
#is_empty? ⇒ Boolean
113
114
115
|
# File 'lib/rgeo/geos/zm_impl.rb', line 113
def is_empty?
@zgeometry.is_empty?
end
|
#is_simple? ⇒ Boolean
118
119
120
|
# File 'lib/rgeo/geos/zm_impl.rb', line 118
def is_simple?
@zgeometry.is_simple?
end
|
#m_geometry ⇒ Object
73
74
75
|
# File 'lib/rgeo/geos/zm_impl.rb', line 73
def m_geometry
@mgeometry
end
|
#overlaps?(rhs_) ⇒ Boolean
163
164
165
|
# File 'lib/rgeo/geos/zm_impl.rb', line 163
def overlaps?(rhs_)
@zgeometry.overlaps?(rhs_)
end
|
#relate(rhs_, pattern_) ⇒ Object
168
169
170
|
# File 'lib/rgeo/geos/zm_impl.rb', line 168
def relate(rhs_, pattern_)
@zgeometry.relate(rhs_, pattern_)
end
|
#srid ⇒ Object
93
94
95
|
# File 'lib/rgeo/geos/zm_impl.rb', line 93
def srid
@factory.srid
end
|
#sym_difference(rhs_) ⇒ Object
203
204
205
|
# File 'lib/rgeo/geos/zm_impl.rb', line 203
def sym_difference(rhs_)
ZMGeometryImpl.create(@factory, @zgeometry.sym_difference(rhs_), @mgeometry.sym_difference(rhs_))
end
|
#to_s ⇒ Object
58
59
60
|
# File 'lib/rgeo/geos/zm_impl.rb', line 58
def to_s as_text
end
|
#touches?(rhs_) ⇒ Boolean
143
144
145
|
# File 'lib/rgeo/geos/zm_impl.rb', line 143
def touches?(rhs_)
@zgeometry.touches?(rhs_)
end
|
#union(rhs_) ⇒ Object
Also known as:
+
193
194
195
|
# File 'lib/rgeo/geos/zm_impl.rb', line 193
def union(rhs_)
ZMGeometryImpl.create(@factory, @zgeometry.union(rhs_), @mgeometry.union(rhs_))
end
|
#within?(rhs_) ⇒ Boolean
153
154
155
|
# File 'lib/rgeo/geos/zm_impl.rb', line 153
def within?(rhs_)
@zgeometry.within?(rhs_)
end
|
#z_geometry ⇒ Object
68
69
70
|
# File 'lib/rgeo/geos/zm_impl.rb', line 68
def z_geometry
@zgeometry
end
|