Class: Proj::Area
- Inherits:
-
Object
- Object
- Proj::Area
- Defined in:
- lib/proj/area.rb
Overview
Areas are used to specify the area of use for the choice of relevant coordinate operations. See Transformation#new
Instance Attribute Summary collapse
-
#east_lon_degree ⇒ Object
readonly
Returns the value of attribute east_lon_degree.
-
#name ⇒ Object
Returns the value of attribute name.
-
#north_lat_degree ⇒ Object
readonly
Returns the value of attribute north_lat_degree.
-
#south_lat_degree ⇒ Object
readonly
Returns the value of attribute south_lat_degree.
-
#west_lon_degree ⇒ Object
readonly
Returns the value of attribute west_lon_degree.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, name: nil) ⇒ Area
constructor
A new instance of Area.
-
#set_bounds(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:) ⇒ Object
Sets the bounds for an area.
- #to_ptr ⇒ Object
-
#to_s ⇒ String
Returns nice printout of an Area.
Constructor Details
#initialize(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, name: nil) ⇒ Area
Returns a new instance of Area.
15 16 17 18 19 20 21 22 |
# File 'lib/proj/area.rb', line 15 def initialize(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, name: nil) @west_lon_degree = west_lon_degree @south_lat_degree = south_lat_degree @east_lon_degree = east_lon_degree @north_lat_degree = north_lat_degree @name = name create_area end |
Instance Attribute Details
#east_lon_degree ⇒ Object (readonly)
Returns the value of attribute east_lon_degree.
7 8 9 |
# File 'lib/proj/area.rb', line 7 def east_lon_degree @east_lon_degree end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/proj/area.rb', line 7 def name @name end |
#north_lat_degree ⇒ Object (readonly)
Returns the value of attribute north_lat_degree.
7 8 9 |
# File 'lib/proj/area.rb', line 7 def north_lat_degree @north_lat_degree end |
#south_lat_degree ⇒ Object (readonly)
Returns the value of attribute south_lat_degree.
7 8 9 |
# File 'lib/proj/area.rb', line 7 def south_lat_degree @south_lat_degree end |
#west_lon_degree ⇒ Object (readonly)
Returns the value of attribute west_lon_degree.
7 8 9 |
# File 'lib/proj/area.rb', line 7 def west_lon_degree @west_lon_degree end |
Class Method Details
.finalize(pointer) ⇒ Object
9 10 11 12 13 |
# File 'lib/proj/area.rb', line 9 def self.finalize(pointer) proc do Api.proj_area_destroy(pointer) end end |
Instance Method Details
#set_bounds(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:) ⇒ Object
Sets the bounds for an area
36 37 38 |
# File 'lib/proj/area.rb', line 36 def set_bounds(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:) Api.proj_area_set_bbox(self, west_lon_degree, south_lat_degree, east_lon_degree, north_lat_degree) end |
#to_ptr ⇒ Object
24 25 26 |
# File 'lib/proj/area.rb', line 24 def to_ptr @area end |
#to_s ⇒ String
Returns nice printout of an Area
54 55 56 |
# File 'lib/proj/area.rb', line 54 def to_s "Area west_lon_degree: #{self.west_lon_degree}, south_lat_degree: #{self.south_lat_degree}, east_lon_degree: #{self.east_lon_degree}, north_lat_degree: #{self.north_lat_degree}" end |