Class: Proj::CrsInfo
- Inherits:
-
Object
- Object
- Proj::CrsInfo
- Defined in:
- lib/proj/crs_info.rb
Instance Attribute Summary collapse
-
#area_name ⇒ Object
readonly
Returns the value of attribute area_name.
-
#auth_name ⇒ Object
readonly
Returns the value of attribute auth_name.
-
#bbox_valid ⇒ Object
readonly
Returns the value of attribute bbox_valid.
-
#celestial_body_name ⇒ Object
readonly
Returns the value of attribute celestial_body_name.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#deprecated ⇒ Object
readonly
Returns the value of attribute deprecated.
-
#east_lon_degree ⇒ Object
readonly
Returns the value of attribute east_lon_degree.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#north_lat_degree ⇒ Object
readonly
Returns the value of attribute north_lat_degree.
-
#projection_method_name ⇒ Object
readonly
Returns the value of attribute projection_method_name.
-
#south_lat_degree ⇒ Object
readonly
Returns the value of attribute south_lat_degree.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#west_lon_degree ⇒ Object
readonly
Returns the value of attribute west_lon_degree.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(auth_name:, code:, name:, type:, deprecated:, bbox_valid:, west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, area_name:, projection_method_name:, celestial_body_name: nil) ⇒ CrsInfo
constructor
A new instance of CrsInfo.
Constructor Details
#initialize(auth_name:, code:, name:, type:, deprecated:, bbox_valid:, west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, area_name:, projection_method_name:, celestial_body_name: nil) ⇒ CrsInfo
Returns a new instance of CrsInfo.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/proj/crs_info.rb', line 29 def initialize(auth_name:, code:, name:, type:, deprecated:, bbox_valid:, west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, area_name:, projection_method_name:, celestial_body_name: nil) @auth_name = auth_name @code = code @name = name @type = type @deprecated = deprecated @bbox_valid = bbox_valid @west_lon_degree = west_lon_degree @south_lat_degree = south_lat_degree @east_lon_degree = east_lon_degree @north_lat_degree = north_lat_degree @area_name = area_name @projection_method_name = projection_method_name @celestial_body_name = celestial_body_name end |
Instance Attribute Details
#area_name ⇒ Object (readonly)
Returns the value of attribute area_name.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def area_name @area_name end |
#auth_name ⇒ Object (readonly)
Returns the value of attribute auth_name.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def auth_name @auth_name end |
#bbox_valid ⇒ Object (readonly)
Returns the value of attribute bbox_valid.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def bbox_valid @bbox_valid end |
#celestial_body_name ⇒ Object (readonly)
Returns the value of attribute celestial_body_name.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def celestial_body_name @celestial_body_name end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def code @code end |
#deprecated ⇒ Object (readonly)
Returns the value of attribute deprecated.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def deprecated @deprecated end |
#east_lon_degree ⇒ Object (readonly)
Returns the value of attribute east_lon_degree.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def east_lon_degree @east_lon_degree end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def name @name end |
#north_lat_degree ⇒ Object (readonly)
Returns the value of attribute north_lat_degree.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def north_lat_degree @north_lat_degree end |
#projection_method_name ⇒ Object (readonly)
Returns the value of attribute projection_method_name.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def projection_method_name @projection_method_name end |
#south_lat_degree ⇒ Object (readonly)
Returns the value of attribute south_lat_degree.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def south_lat_degree @south_lat_degree end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def type @type end |
#west_lon_degree ⇒ Object (readonly)
Returns the value of attribute west_lon_degree.
4 5 6 |
# File 'lib/proj/crs_info.rb', line 4 def west_lon_degree @west_lon_degree end |
Class Method Details
.from_proj_crs_info(proj_crs_info) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/proj/crs_info.rb', line 8 def self.from_proj_crs_info(proj_crs_info) data = {auth_name: proj_crs_info[:auth_name], code: proj_crs_info[:code], name: proj_crs_info[:name], type: proj_crs_info[:type], deprecated: proj_crs_info[:deprecated] == 1 ? true : false, bbox_valid: proj_crs_info[:bbox_valid] == 1 ? true : false, west_lon_degree: proj_crs_info[:west_lon_degree], south_lat_degree: proj_crs_info[:south_lat_degree], east_lon_degree: proj_crs_info[:east_lon_degree], north_lat_degree: proj_crs_info[:north_lat_degree], area_name: proj_crs_info[:area_name], projection_method_name: proj_crs_info[:projection_method_name]} if Api::PROJ_VERSION >= Gem::Version.new('8.1.0') data[:celestial_body_name] = proj_crs_info[:celestial_body_name] end new(**data) end |