module Geos
Constants
- BufferCapStyles
- BufferJoinStyles
- ByteOrders
- DimensionTypes
- Flavors
- GEOS_BASE
- GeometryTypes
- PolygonHullSimplifyModes
- PrecisionOptions
- RelateBoundaryNodeRules
- VERSION
- ValidFlags
Public Class Methods
# File lib/ffi-geos.rb, line 1421 def current_handle Thread.current[:ffi_geos_handle] ||= Geos::Handle.new end
# File lib/ffi-geos.rb, line 1425 def current_handle_pointer current_handle.ptr end
# File lib/ffi-geos.rb, line 1417 def jts_port @jts_port ||= FFIGeos.GEOSjtsport end
# File lib/ffi-geos.rb, line 1429 def srid_copy_policy Thread.current[:ffi_geos_srid_copy_policy] ||= srid_copy_policy_default end
Sets the SRID copying behaviour. This value can be one of the values found in Geos::Constants::SRID_COPY_POLICIES and are local to the current thread. A special value of :default
can also be used, which will use a global default that can be set with srid_copy_policy_default
=. Setting this value will cause all future threads to use this global default rather than the true default value which is set to :zero
for the sake of backwards compatibility with
The available values for policy
are:
-
:default
- use the value set withsrid_copy_policy_default
=, which itself is:zero
. -
:zero
- set all SRIDs to 0. The only exception to this is when cloning aGeometry
, in which the SRID is always copied as per the previous behaviour. -
:lenient
- when copying SRIDs, use the SRID of the object that the operation is being performed on, even if operation involves multipleGeometry
objects that may have different SRIDs. -
:strict
- when copying SRIDs, raise aGeos::MixedSRIDsError
exception if an operation is performed on mixed SRIDs. This setting
# File lib/ffi-geos.rb, line 1453 def srid_copy_policy=(policy) if policy == :default Thread.current[:ffi_geos_srid_copy_policy] = srid_copy_policy_default elsif Geos::Constants::SRID_COPY_POLICIES.include?(policy) Thread.current[:ffi_geos_srid_copy_policy] = policy else raise ArgumentError, "Invalid SRID policy #{policy} (must be one of #{Geos::Constants::SRID_COPY_POLICIES})" end end
# File lib/ffi-geos.rb, line 1463 def srid_copy_policy_default @srid_copy_policy_default ||= :zero end
# File lib/ffi-geos.rb, line 1467 def srid_copy_policy_default=(policy) if policy == :default @srid_copy_policy_default = :zero elsif Geos::Constants::SRID_COPY_POLICIES.include?(policy) @srid_copy_policy_default = policy else raise ArgumentError, "Invalid SRID policy #{policy} (must be one of #{Geos::Constants::SRID_COPY_POLICIES})" end end
# File lib/ffi-geos.rb, line 1413 def version @version ||= FFIGeos.GEOSversion.strip end