Class: Kamelopard::LatLonQuad

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Corresponds to KML’s gx:LatLonQuad object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lowerLeft, lowerRight, upperRight, upperLeft) ⇒ LatLonQuad

Returns a new instance of LatLonQuad.



1664
1665
1666
1667
1668
1669
# File 'lib/kamelopard/classes.rb', line 1664

def initialize(lowerLeft, lowerRight, upperRight, upperLeft)
    @lowerLeft = lowerLeft
    @lowerRight = lowerRight
    @upperRight = upperRight
    @upperLeft = upperLeft
end

Instance Attribute Details

#lowerLeftObject

Returns the value of attribute lowerLeft.



1663
1664
1665
# File 'lib/kamelopard/classes.rb', line 1663

def lowerLeft
  @lowerLeft
end

#lowerRightObject

Returns the value of attribute lowerRight.



1663
1664
1665
# File 'lib/kamelopard/classes.rb', line 1663

def lowerRight
  @lowerRight
end

#upperLeftObject

Returns the value of attribute upperLeft.



1663
1664
1665
# File 'lib/kamelopard/classes.rb', line 1663

def upperLeft
  @upperLeft
end

#upperRightObject

Returns the value of attribute upperRight.



1663
1664
1665
# File 'lib/kamelopard/classes.rb', line 1663

def upperRight
  @upperRight
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1671
1672
1673
1674
1675
1676
1677
1678
# File 'lib/kamelopard/classes.rb', line 1671

def to_kml(elem = nil)
    k = XML::Node.new 'gx:LatLonQuad'
    d = XML::Node.new 'coordinates'
    d << "#{ @lowerLeft.longitude },#{ @lowerLeft.latitude } #{ @lowerRight.longitude },#{ @lowerRight.latitude } #{ @upperRight.longitude },#{ @upperRight.latitude } #{ @upperLeft.longitude },#{ @upperLeft.latitude }"
    k << d
    elem << k unless elem.nil?
    k
end