A factory for Geos that handles both Z and M.
Create a new factory. Returns nil if the GEOS implementation is not supported.
# File lib/rgeo/geos/zm_factory.rb, line 72 def create(opts_={}) return nil unless Geos.supported? new(opts_) end
Returns the resolution used by buffer calculations on geometries created by this factory
# File lib/rgeo/geos/zm_factory.rb, line 256 def buffer_resolution @zfactory.buffer_resolution end
See RGeo::Feature::Factory#collection
# File lib/rgeo/geos/zm_factory.rb, line 360 def collection(elems_) _create_feature(ZMGeometryCollectionImpl, @zfactory.collection(elems_), @mfactory.collection(elems_)) end
See RGeo::Feature::Factory#coord_sys
# File lib/rgeo/geos/zm_factory.rb, line 395 def coord_sys @zfactory.coord_sys end
Factory equivalence test.
# File lib/rgeo/geos/zm_factory.rb, line 284 def eql?(rhs_) rhs_.is_a?(ZMFactory) && rhs_.z_factory == @zfactory end
Standard hash code
# File lib/rgeo/geos/zm_factory.rb, line 292 def hash @hash ||= [@zfactory, @mfactory].hash end
Returns true if this factory is lenient with MultiPolygon assertions
# File lib/rgeo/geos/zm_factory.rb, line 263 def lenient_multi_polygon_assertions? @zfactory.lenient_multi_polygon_assertions? end
See RGeo::Feature::Factory#line
# File lib/rgeo/geos/zm_factory.rb, line 339 def line(start_, end_) _create_feature(ZMLineImpl, @zfactory.line(start_, end_), @mfactory.line(start_, end_)) end
See RGeo::Feature::Factory#line_string
# File lib/rgeo/geos/zm_factory.rb, line 332 def line_string(points_) _create_feature(ZMLineStringImpl, @zfactory.line_string(points_), @mfactory.line_string(points_)) end
See RGeo::Feature::Factory#linear_ring
# File lib/rgeo/geos/zm_factory.rb, line 346 def linear_ring(points_) _create_feature(ZMLinearRingImpl, @zfactory.linear_ring(points_), @mfactory.linear_ring(points_)) end
Returns the m-only factory corresponding to this factory.
# File lib/rgeo/geos/zm_factory.rb, line 277 def m_factory @mfactory end
See RGeo::Feature::Factory#multi_line_string
# File lib/rgeo/geos/zm_factory.rb, line 374 def multi_line_string(elems_) _create_feature(ZMMultiLineStringImpl, @zfactory.multi_line_string(elems_), @mfactory.multi_line_string(elems_)) end
See RGeo::Feature::Factory#multi_point
# File lib/rgeo/geos/zm_factory.rb, line 367 def multi_point(elems_) _create_feature(ZMMultiPointImpl, @zfactory.multi_point(elems_), @mfactory.multi_point(elems_)) end
See RGeo::Feature::Factory#multi_polygon
# File lib/rgeo/geos/zm_factory.rb, line 381 def multi_polygon(elems_) _create_feature(ZMMultiPolygonImpl, @zfactory.multi_polygon(elems_), @mfactory.multi_polygon(elems_)) end
See RGeo::Feature::Factory#override_cast
# File lib/rgeo/geos/zm_factory.rb, line 402 def override_cast(original_, ntype_, flags_) return nil unless Geos.supported? keep_subtype_ = flags_[:keep_subtype] #force_new_ = flags_[:force_new] project_ = flags_[:project] type_ = original_.geometry_type ntype_ = type_ if keep_subtype_ && type_.include?(ntype_) case original_ when ZMGeometryMethods # Optimization if we're just changing factories, but to # another ZM factory. if original_.factory != self && ntype_ == type_ && (!project_ || original_.factory.proj4 == @proj4) then zresult_ = original_.z_geometry.dup zresult_._set_factory(@zfactory) mresult_ = original_.m_geometry.dup mresult_._set_factory(@mfactory) return original_.class.create(self, zresult_, mresult_) end # LineString conversion optimization. if (original_.factory != self || ntype_ != type_) && (!project_ || original_.factory.proj4 == @proj4) && type_.subtype_of?(Feature::LineString) && ntype_.subtype_of?(Feature::LineString) then klass_ = Factory::IMPL_CLASSES[ntype_] zresult_ = klass_._copy_from(@zfactory, original_.z_geometry) mresult_ = klass_._copy_from(@mfactory, original_.m_geometry) return ZMLineStringImpl.create(self, zresult_, mresult_) end end false end
See RGeo::Feature::Factory#parse_wkb
# File lib/rgeo/geos/zm_factory.rb, line 318 def parse_wkb(str_) @wkb_parser.parse(str_) end
See RGeo::Feature::Factory#parse_wkt
# File lib/rgeo/geos/zm_factory.rb, line 311 def parse_wkt(str_) @wkt_parser.parse(str_) end
See RGeo::Feature::Factory#point
# File lib/rgeo/geos/zm_factory.rb, line 325 def point(x_, y_, z_=0, m_=0) _create_feature(ZMPointImpl, @zfactory.point(x_, y_, z_), @mfactory.point(x_, y_, m_)) end
See RGeo::Feature::Factory#polygon
# File lib/rgeo/geos/zm_factory.rb, line 353 def polygon(outer_ring_, inner_rings_=nil) _create_feature(ZMPolygonImpl, @zfactory.polygon(outer_ring_, inner_rings_), @mfactory.polygon(outer_ring_, inner_rings_)) end
See RGeo::Feature::Factory#proj4
# File lib/rgeo/geos/zm_factory.rb, line 388 def proj4 @zfactory.proj4 end
See RGeo::Feature::Factory#property
# File lib/rgeo/geos/zm_factory.rb, line 299 def property(name_) case name_ when :has_z_coordinate, :has_m_coordinate, :is_cartesian true else nil end end
Returns the SRID of geometries created by this factory.
# File lib/rgeo/geos/zm_factory.rb, line 248 def srid @zfactory.srid end
Returns the z-only factory corresponding to this factory.
# File lib/rgeo/geos/zm_factory.rb, line 270 def z_factory @zfactory end