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.



1598
1599
1600
1601
1602
1603
# File 'lib/kamelopard/classes.rb', line 1598

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.



1597
1598
1599
# File 'lib/kamelopard/classes.rb', line 1597

def lowerLeft
  @lowerLeft
end

#lowerRightObject

Returns the value of attribute lowerRight.



1597
1598
1599
# File 'lib/kamelopard/classes.rb', line 1597

def lowerRight
  @lowerRight
end

#upperLeftObject

Returns the value of attribute upperLeft.



1597
1598
1599
# File 'lib/kamelopard/classes.rb', line 1597

def upperLeft
  @upperLeft
end

#upperRightObject

Returns the value of attribute upperRight.



1597
1598
1599
# File 'lib/kamelopard/classes.rb', line 1597

def upperRight
  @upperRight
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1605
1606
1607
1608
1609
1610
1611
1612
# File 'lib/kamelopard/classes.rb', line 1605

def to_kml(elem = nil)
    k = REXML::Element.new 'gx:LatLonQuad'
    d = REXML::Element.new 'coordinates'
    d.text = "#{ @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