Class: Proj4::Point

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

Overview

This class represents a point in either lon/lat or projected x/y coordinates.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, z = 0) ⇒ Point

Create new Proj4::Point object from coordinates.



335
336
337
338
339
# File 'lib/proj4.rb', line 335

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

Instance Attribute Details

#xObject

X coordinate or longitude



326
327
328
# File 'lib/proj4.rb', line 326

def x
  @x
end

#yObject

Y coordinate or latitude



329
330
331
# File 'lib/proj4.rb', line 329

def y
  @y
end

#zObject

Z coordinate (height)



332
333
334
# File 'lib/proj4.rb', line 332

def z
  @z
end

Instance Method Details

#latObject

Get latitude/y coordinate.



347
348
349
# File 'lib/proj4.rb', line 347

def lat
  y
end

#lat=(lat) ⇒ Object

Set latitude/y coordinate.



357
358
359
# File 'lib/proj4.rb', line 357

def lat=(lat)
  @y = lat
end

#lonObject

Get longitude/x coordinate.



342
343
344
# File 'lib/proj4.rb', line 342

def lon
  x
end

#lon=(lon) ⇒ Object

Set longitude/x coordinate.



352
353
354
# File 'lib/proj4.rb', line 352

def lon=(lon)
  @x = lon
end