Module: RGeo::ImplHelper::ValidOp

Overview

Mixin based off of the JTS/GEOS IsValidOp class. Implements #valid? and #invalid_reason on Features that include this.

Instance Method Summary collapse

Instance Method Details

#invalid_reasonObject

Reason for invalidity or nil if valid

Returns:

  • String



22
23
24
25
# File 'lib/rgeo/impl_helper/valid_op.rb', line 22

def invalid_reason
  return @invalid_reason if defined?(@invalid_reason)
  @invalid_reason = check_valid
end

#valid?Boolean

Validity of geometry

Returns:

  • (Boolean)

    Boolean



15
16
17
# File 'lib/rgeo/impl_helper/valid_op.rb', line 15

def valid?
  invalid_reason.nil?
end