Class: RGeo::CoordSys::CS::Projection

Inherits:
Info
  • Object
show all
Defined in:
lib/rgeo/coord_sys/cs/entities.rb

Overview

OGC spec description

A projection from geographic coordinates to projected coordinates.

Instance Attribute Summary collapse

Attributes inherited from Info

#abbreviation, #alias, #authority, #authority_code, #name, #remarks

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#_to_wkt, #eql?, #inspect, #to_s, #to_wkt

Constructor Details

#initialize(name_, class_name_, parameters_, *optional_) ⇒ Projection

:nodoc:



919
920
921
922
923
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 919

def initialize(name_, class_name_, parameters_, *optional_)  # :nodoc:
  super(name_, *optional_)
  @class_name = class_name_.to_s
  @parameters = parameters_ ? parameters_.dup : []
end

Instance Attribute Details

#class_nameObject (readonly)

Gets the projection classification name (e.g. “Transverse_Mercator”).



928
929
930
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 928

def class_name
  @class_name
end

Class Method Details

.create(name_, class_name_, parameters_, *optional_) ⇒ Object

Create a Projection given a name, a projection class, and an array of ProjectionParameter. You may also provide the optional parameters specified by the Info interface.



968
969
970
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 968

def create(name_, class_name_, parameters_, *optional_)
  new(name_, class_name_, parameters_, *optional_)
end

Instance Method Details

#_wkt_content(open_, close_) ⇒ Object

:nodoc:



956
957
958
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 956

def _wkt_content(open_, close_)  # :nodoc:
  []
end

#_wkt_typenameObject

:nodoc:



952
953
954
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 952

def _wkt_typename  # :nodoc:
  "PROJECTION"
end

#each_parameter(&block_) ⇒ Object

Iterates over the parameters of the projection.



947
948
949
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 947

def each_parameter(&block_)
  @parameters.each(&block_)
end

#get_parameter(index_) ⇒ Object

Gets an inexed parameter of the projection.



940
941
942
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 940

def get_parameter(index_)
  @parameters[index_]
end

#num_parametersObject

Gets number of parameters of the projection.



933
934
935
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 933

def num_parameters
  @parameters.size
end