Class: Proj4::Point
- Inherits:
-
Object
- Object
- Proj4::Point
- Defined in:
- lib/proj4.rb
Overview
This class represents a point in either lon/lat or projected x/y coordinates.
Instance Attribute Summary collapse
-
#x ⇒ Object
X coordinate or longitude.
-
#y ⇒ Object
Y coordinate or latitude.
-
#z ⇒ Object
Z coordinate (height).
Instance Method Summary collapse
-
#initialize(x, y, z = 0) ⇒ Point
constructor
Create new Proj4::Point object from coordinates.
-
#lat ⇒ Object
Get latitude/y coordinate.
-
#lat=(lat) ⇒ Object
Set latitude/y coordinate.
-
#lon ⇒ Object
Get longitude/x coordinate.
-
#lon=(lon) ⇒ Object
Set longitude/x coordinate.
Constructor Details
#initialize(x, y, z = 0) ⇒ Point
Create new Proj4::Point object from coordinates.
334 335 336 337 338 |
# File 'lib/proj4.rb', line 334 def initialize(x, y, z=0) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object
X coordinate or longitude
325 326 327 |
# File 'lib/proj4.rb', line 325 def x @x end |
#y ⇒ Object
Y coordinate or latitude
328 329 330 |
# File 'lib/proj4.rb', line 328 def y @y end |
#z ⇒ Object
Z coordinate (height)
331 332 333 |
# File 'lib/proj4.rb', line 331 def z @z end |
Instance Method Details
#lat ⇒ Object
Get latitude/y coordinate.
346 347 348 |
# File 'lib/proj4.rb', line 346 def lat y end |
#lat=(lat) ⇒ Object
Set latitude/y coordinate.
356 357 358 |
# File 'lib/proj4.rb', line 356 def lat=(lat) @y = lat end |
#lon ⇒ Object
Get longitude/x coordinate.
341 342 343 |
# File 'lib/proj4.rb', line 341 def lon x end |
#lon=(lon) ⇒ Object
Set longitude/x coordinate.
351 352 353 |
# File 'lib/proj4.rb', line 351 def lon=(lon) @x = lon end |