Class: NationalGrid::EastingNorthing
- Inherits:
-
Object
- Object
- NationalGrid::EastingNorthing
- Defined in:
- lib/national_grid/easting_northing.rb,
ext/national_grid/national_grid_easting_northing.c
Instance Method Summary collapse
- #easting ⇒ Object
- #elevation ⇒ Object
- #initialize(*args) ⇒ Object constructor
- #northing ⇒ Object
- #to_a ⇒ Object
- #to_latitude_longitude ⇒ Object
Methods included from Round
Methods included from Inspect
Constructor Details
#initialize(*args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'ext/national_grid/national_grid_easting_northing.c', line 16 static VALUE initialize(int argc, VALUE* argv, VALUE self) { VALUE easting, northing, elevation; rb_scan_args(argc, argv, "03", &easting, &northing, &elevation); EastingNorthing* data = easting_northing(self); data->e = default_to_zero(easting); data->n = default_to_zero(northing); data->elevation = default_to_zero(elevation); return self; } |
Instance Method Details
#easting ⇒ Object
28 29 30 |
# File 'ext/national_grid/national_grid_easting_northing.c', line 28 static VALUE easting(VALUE self) { return DBL2NUM(easting_northing(self)->e); } |
#elevation ⇒ Object
36 37 38 |
# File 'ext/national_grid/national_grid_easting_northing.c', line 36 static VALUE elevation(VALUE self) { return DBL2NUM(easting_northing(self)->elevation); } |
#northing ⇒ Object
32 33 34 |
# File 'ext/national_grid/national_grid_easting_northing.c', line 32 static VALUE northing(VALUE self) { return DBL2NUM(easting_northing(self)->n); } |
#to_a ⇒ Object
6 7 8 |
# File 'lib/national_grid/easting_northing.rb', line 6 def to_a [easting, northing, elevation] end |
#to_latitude_longitude ⇒ Object
40 41 42 43 44 |
# File 'ext/national_grid/national_grid_easting_northing.c', line 40 static VALUE to_latitude_longitude(VALUE self) { LatLonDecimal data = ETRS89LatLonFromETRS89EastingNorthing(ETRS89EastingNorthingFromOSGB36EastingNorthing(*easting_northing(self))); if (data.geoid == 0) return Qnil; return new_national_grid_latitude_longitude(data); } |