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 Info

#extension

Methods inherited from Base

#_to_wkt, #encode_with, #eql?, #hash, #init_with, #inspect, #marshal_dump, #marshal_load, #to_s, #to_wkt

Constructor Details

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

:nodoc:



817
818
819
820
821
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 817

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”).



825
826
827
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 825

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.



858
859
860
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 858

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

Instance Method Details

#_wkt_content(_open_, _close_) ⇒ Object

:nodoc:



849
850
851
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 849

def _wkt_content(_open_, _close_) # :nodoc:
  []
end

#_wkt_typenameObject

:nodoc:



845
846
847
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 845

def _wkt_typename # :nodoc:
  "PROJECTION"
end

#each_parameter(&block_) ⇒ Object

Iterates over the parameters of the projection.



841
842
843
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 841

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

#get_parameter(index_) ⇒ Object

Gets an inexed parameter of the projection.



835
836
837
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 835

def get_parameter(index_)
  @parameters[index_]
end

#num_parametersObject

Gets number of parameters of the projection.



829
830
831
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 829

def num_parameters
  @parameters.size
end