lib/rgeo/geos/factory.rb in rgeo-0.1.21 vs lib/rgeo/geos/factory.rb in rgeo-0.1.22

- old
+ new

@@ -57,12 +57,12 @@ def create(opts_={}) return nil unless respond_to?(:_create) flags_ = 0 flags_ |= 1 if opts_[:lenient_multi_polygon_assertions] - flags_ |= 2 if opts_[:support_z_coordinate] - flags_ |= 4 if opts_[:support_m_coordinate] + flags_ |= 2 if opts_[:has_z_coordinate] + flags_ |= 4 if opts_[:has_m_coordinate] if flags_ & 6 == 6 raise Error::UnsupportedCapability, "GEOS cannot support both Z and M coordinates at the same time." end buffer_resolution_ = opts_[:buffer_resolution].to_i buffer_resolution_ = 1 if buffer_resolution_ < 1 @@ -117,20 +117,20 @@ def lenient_multi_polygon_assertions? _flags & 0x1 != 0 end - # See ::RGeo::Feature::Factory#has_capability? + # See ::RGeo::Feature::Factory#property - def has_capability?(name_) + def property(name_) case name_ - when :z_coordinate + when :has_z_coordinate _flags & 0x2 != 0 - when :m_coordinate + when :has_m_coordinate _flags & 0x4 != 0 - when :proj4 - !@proj4.nil? + when :is_cartesian + true else nil end end @@ -221,10 +221,24 @@ elems_ = elems_.to_a unless elems_.kind_of?(::Array) MultiPolygonImpl.create(self, elems_) rescue nil end + # See ::RGeo::Feature::Factory#proj4 + + def proj4 + @proj4 + end + + + # See ::RGeo::Feature::Factory#coord_sys + + def coord_sys + nil + end + + # See ::RGeo::Feature::Factory#override_cast def override_cast(original_, ntype_, flags_) return nil unless Geos.supported? keep_subtype_ = flags_[:keep_subtype] @@ -257,16 +271,9 @@ elsif _flags & 0x6 == 0x4 && self == original_.factory.m_factory return Feature.cast(original_.m_geometry, ntype_, flags_) end end false - end - - - # See ::RGeo::Feature::Factory#proj4 - - def proj4 - @proj4 end end