Permalink
Browse files

Fix is_geos for environments where there is no CAPI

  • Loading branch information...
1 parent 2acce8a commit fd2d75096f707d79d37a4d85b8c740e0117763cb @dazuma dazuma committed Aug 3, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/rgeo/geos/interface.rb
View
@@ -67,28 +67,30 @@ def supported?
# the given factory is a CAPI GEOS factory.
def is_capi_geos?(object_)
- CAPIFactory === object_ || CAPIGeometryMethods === object_ ||
+ CAPI_SUPPORTED &&
+ (CAPIFactory === object_ || CAPIGeometryMethods === object_ ||
ZMFactory === object_ && CAPIFactory === object_.z_factory ||
- ZMGeometryMethods === object_ && CAPIGeometryMethods === object_.z_geometry
+ ZMGeometryMethods === object_ && CAPIGeometryMethods === object_.z_geometry)
end
# Returns true if the given feature is an FFI GEOS feature, or if
# the given factory is an FFI GEOS factory.
def is_ffi_geos?(object_)
- FFIFactory === object_ || FFIGeometryMethods === object_ ||
+ FFI_SUPPORTED &&
+ (FFIFactory === object_ || FFIGeometryMethods === object_ ||
ZMFactory === object_ && FFIFactory === object_.z_factory ||
- ZMGeometryMethods === object_ && FFIGeometryMethods === object_.z_geometry
+ ZMGeometryMethods === object_ && FFIGeometryMethods === object_.z_geometry)
end
# Returns true if the given feature is a GEOS feature, or if the given
# factory is a GEOS factory. Does not distinguish between CAPI and FFI.
def is_geos?(object_)
- CAPIFactory === object_ || CAPIGeometryMethods === object_ ||
- FFIFactory === object_ || FFIGeometryMethods === object_ ||
+ CAPI_SUPPORTED && (CAPIFactory === object_ || CAPIGeometryMethods === object_) ||
+ FFI_SUPPORTED && (FFIFactory === object_ || FFIGeometryMethods === object_) ||
ZMFactory === object_ || ZMGeometryMethods === object_
end

0 comments on commit fd2d750

Please sign in to comment.