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.
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.
16 17 18 19 20 21 22 23 |
# File 'lib/proj/area.rb', line 16 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 |
Instance Method Details
#set_bounds(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:) ⇒ Object
Sets the bounds for an area
37 38 39 |
# File 'lib/proj/area.rb', line 37 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
25 26 27 |
# File 'lib/proj/area.rb', line 25 def to_ptr @area end |
#to_s ⇒ String
Returns nice printout of an Area
55 56 57 |
# File 'lib/proj/area.rb', line 55 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 |