Class: Hierclust::Point

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#placemarkObject

Returns the value of attribute placemark.



8
9
10
# File 'lib/kamelopard/regionate.rb', line 8

def placemark
  @placemark
end

Instance Method Details

#<=>(a) ⇒ Object



9
10
11
# File 'lib/kamelopard/regionate.rb', line 9

def <=>(a)
    raise "Something called this!"
end

#distance_to(b) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/kamelopard/regionate.rb', line 13

def distance_to(b)
    if self.is_a? Hierclust::Point then
        pt1 = point(self.x, self.y)
    else
        pt1 = self.placemark.geometry
    end
    if b.is_a? Hierclust::Point then
        pt2 = point(b.x, b.y)
    else
        pt2 = b.placemark.geometry
    end
    great_circle_distance(pt1, pt2)
end