class Geospatial::Point
A point is a location on a map with a specific hash representation based on the map. A point might store multi-dimentional data (e.g. longitude, latitude, time) which is hashed to a single column.
Attributes
coordinates[R]
object[R]
to_a[R]
Public Class Methods
new(map, coordinates, object = nil)
click to toggle source
# File lib/geospatial/map.rb, line 30 def initialize(map, coordinates, object = nil) @map = map @coordinates = coordinates @object = object end
Public Instance Methods
[](index)
click to toggle source
# File lib/geospatial/map.rb, line 38 def [] index @coordinates[index] end
[]=(index, value)
click to toggle source
# File lib/geospatial/map.rb, line 42 def []= index, value @coordinates[index] = value end
eql?(other)
click to toggle source
# File lib/geospatial/map.rb, line 50 def eql?(other) self.class.eql?(other.class) and @coordinates.eql?(other.coordinates) end
hash()
click to toggle source
# File lib/geospatial/map.rb, line 54 def hash @hash ||= @map.hash_for_coordinates(@coordinates).freeze end