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.



2162
2163
2164
2165
2166
2167
# File 'lib/kamelopard/classes.rb', line 2162

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.



2161
2162
2163
# File 'lib/kamelopard/classes.rb', line 2161

def lowerLeft
  @lowerLeft
end

#lowerRightObject

Returns the value of attribute lowerRight.



2161
2162
2163
# File 'lib/kamelopard/classes.rb', line 2161

def lowerRight
  @lowerRight
end

#upperLeftObject

Returns the value of attribute upperLeft.



2161
2162
2163
# File 'lib/kamelopard/classes.rb', line 2161

def upperLeft
  @upperLeft
end

#upperRightObject

Returns the value of attribute upperRight.



2161
2162
2163
# File 'lib/kamelopard/classes.rb', line 2161

def upperRight
  @upperRight
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



2169
2170
2171
2172
2173
2174
2175
2176
# File 'lib/kamelopard/classes.rb', line 2169

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