Class: RegionExtractor::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/region_extractor/point.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ Point

Returns a new instance of Point.



6
7
8
9
# File 'lib/region_extractor/point.rb', line 6

def initialize(x,y)
  @x = x
  @y = y
end

Instance Attribute Details

#xObject

Returns the value of attribute x.



4
5
6
# File 'lib/region_extractor/point.rb', line 4

def x
  @x
end

#yObject

Returns the value of attribute y.



4
5
6
# File 'lib/region_extractor/point.rb', line 4

def y
  @y
end

Class Method Details

.tranform_point(point, origin_projection, destination_projection) ⇒ Object



11
12
13
14
# File 'lib/region_extractor/point.rb', line 11

def self.tranform_point(point, origin_projection, destination_projection)
  output = origin_projection.transform(destination_projection, point)
  Point.new(output.x * Proj4::RAD_TO_DEG, output.y * Proj4::RAD_TO_DEG)
end