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

#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:



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

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



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

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.



871
872
873
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 871

def create(name, class_name, parameters, *optional)
  new(name, class_name, parameters, *optional)
end

Instance Method Details

#each_parameter(&block) ⇒ Object

Iterates over the parameters of the projection.



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

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

#get_parameter(index) ⇒ Object

Gets an inexed parameter of the projection.



852
853
854
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 852

def get_parameter(index)
  @parameters[index]
end

#num_parametersObject

Gets number of parameters of the projection.



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

def num_parameters
  @parameters.size
end

#wkt_typenameObject



862
863
864
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 862

def wkt_typename
  "PROJECTION"
end