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:


986
987
988
989
990
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 986

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


995
996
997
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 995

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.


1035
1036
1037
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1035

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

Instance Method Details

#_wkt_content(open_, close_) ⇒ Object

:nodoc:


1023
1024
1025
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1023

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

#_wkt_typenameObject

:nodoc:


1019
1020
1021
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1019

def _wkt_typename  # :nodoc:
  "PROJECTION"
end

#each_parameter(&block_) ⇒ Object

Iterates over the parameters of the projection.


1014
1015
1016
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1014

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

#get_parameter(index_) ⇒ Object

Gets an inexed parameter of the projection.


1007
1008
1009
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1007

def get_parameter(index_)
  @parameters[index_]
end

#num_parametersObject

Gets number of parameters of the projection.


1000
1001
1002
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1000

def num_parameters
  @parameters.size
end