Class: GeoSwap::UtmPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_swap/utm_point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ UtmPoint

Returns a new instance of UtmPoint.



6
7
8
9
10
11
# File 'lib/geo_swap/utm_point.rb', line 6

def initialize(attrs)
  @easting = attrs.fetch(:easting)
  @northing = attrs.fetch(:northing)
  @zone = attrs.fetch(:zone)
  @hemisphere = attrs.fetch(:hemisphere)
end

Instance Attribute Details

#eastingObject (readonly)

Returns the value of attribute easting.



4
5
6
# File 'lib/geo_swap/utm_point.rb', line 4

def easting
  @easting
end

#hemisphereObject (readonly)

Returns the value of attribute hemisphere.



4
5
6
# File 'lib/geo_swap/utm_point.rb', line 4

def hemisphere
  @hemisphere
end

#northingObject (readonly)

Returns the value of attribute northing.



4
5
6
# File 'lib/geo_swap/utm_point.rb', line 4

def northing
  @northing
end

#zoneObject (readonly)

Returns the value of attribute zone.



4
5
6
# File 'lib/geo_swap/utm_point.rb', line 4

def zone
  @zone
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/geo_swap/utm_point.rb', line 13

def to_s
  "#{zone.number}#{zone.letter} #{easting}mE #{northing}mN"
end