class OGR::Envelope

Attributes

c_struct[R]

@return [FFI::OGR::Envelope, FFI::OGR::Envelope3D] The C struct that this

object wraps.

Public Class Methods

new(envelope_struct = nil, three_d: false) click to toggle source

@param envelope_struct [FFI::OGR::Envelope]

# File lib/ogr/envelope.rb, line 12
def initialize(envelope_struct = nil, three_d: false)
  @c_struct = envelope_struct
  @c_struct ||= three_d ? FFI::OGR::Envelope3D.new : FFI::OGR::Envelope.new
end

Public Instance Methods

c_pointer() click to toggle source

@return [FFI::Pointer] Pointer to the C struct.

# File lib/ogr/envelope.rb, line 18
def c_pointer
  @c_struct.to_ptr
end
x_max() click to toggle source

@return [Float]

# File lib/ogr/envelope.rb, line 33
def x_max
  @c_struct[:max_x]
end
x_max=(new_x_max) click to toggle source

@param new_x_max [Float]

# File lib/ogr/envelope.rb, line 38
def x_max=(new_x_max)
  @c_struct[:max_x] = new_x_max
end
x_min() click to toggle source

@return [Float]

# File lib/ogr/envelope.rb, line 23
def x_min
  @c_struct[:min_x]
end
x_min=(new_x_min) click to toggle source

@param new_x_min [Float]

# File lib/ogr/envelope.rb, line 28
def x_min=(new_x_min)
  @c_struct[:min_x] = new_x_min
end
y_max() click to toggle source

@return [Float]

# File lib/ogr/envelope.rb, line 53
def y_max
  @c_struct[:max_y]
end
y_max=(new_y_max) click to toggle source

@param new_y_max [Float]

# File lib/ogr/envelope.rb, line 58
def y_max=(new_y_max)
  @c_struct[:max_y] = new_y_max
end
y_min() click to toggle source

@return [Float]

# File lib/ogr/envelope.rb, line 43
def y_min
  @c_struct[:min_y]
end
y_min=(new_y_min) click to toggle source

@param new_y_min [Float]

# File lib/ogr/envelope.rb, line 48
def y_min=(new_y_min)
  @c_struct[:min_y] = new_y_min
end
z_max() click to toggle source

@return [Float, nil]

# File lib/ogr/envelope.rb, line 77
def z_max
  return nil unless @c_struct.is_a? FFI::OGR::Envelope3D

  @c_struct[:max_z]
end
z_max=(new_z_max) click to toggle source

@param new_z_max [Float]

# File lib/ogr/envelope.rb, line 84
def z_max=(new_z_max)
  return unless @c_struct.is_a? FFI::OGR::Envelope3D

  @c_struct[:max_z] = new_z_max
end
z_min() click to toggle source

@return [Float, nil]

# File lib/ogr/envelope.rb, line 63
def z_min
  return nil unless @c_struct.is_a? FFI::OGR::Envelope3D

  @c_struct[:min_z]
end
z_min=(new_z_min) click to toggle source

@param new_z_min [Float]

# File lib/ogr/envelope.rb, line 70
def z_min=(new_z_min)
  return unless @c_struct.is_a? FFI::OGR::Envelope3D

  @c_struct[:min_z] = new_z_min
end