Class: RGeo::CoordSys::CS::CompoundCoordinateSystem

Inherits:
CoordinateSystem show all
Defined in:
lib/rgeo/coord_sys/cs/entities.rb

Overview

OGC spec description

An aggregate of two coordinate systems (CRS). One of these is usually a CRS based on a two dimensional coordinate system such as a geographic or a projected coordinate system with a horizontal datum. The other is a vertical CRS which is a one-dimensional coordinate system with a vertical datum.

Instance Attribute Summary collapse

Attributes inherited from CoordinateSystem

#dimension

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_, head_, tail_, *optional_) ⇒ CompoundCoordinateSystem

:nodoc:



1048
1049
1050
1051
1052
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1048

def initialize(name_, head_, tail_, *optional_)  # :nodoc:
  super(name_, head_.dimension + tail_.dimension, *optional_)
  @head = head_
  @tail = tail_
end

Instance Attribute Details

#headObject (readonly)

Gets first sub-coordinate system.



1056
1057
1058
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1056

def head
  @head
end

#tailObject (readonly)

Gets second sub-coordinate system.



1059
1060
1061
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1059

def tail
  @tail
end

Class Method Details

.create(name_, head_, tail_, *optional_) ⇒ Object

Create a CompoundCoordinateSystem given two sub-coordinate systems. You may also provide the optional parameters specified by the Info interface.



1094
1095
1096
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1094

def create(name_, head_, tail_, *optional_)
  new(name_, head_, tail_, *optional_)
end

Instance Method Details

#_wkt_content(open_, close_) ⇒ Object

:nodoc:



1082
1083
1084
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1082

def _wkt_content(open_, close_)  # :nodoc:
  [@head._to_wkt(open_, close_), @tail._to_wkt(open_, close_)]
end

#_wkt_typenameObject

:nodoc:



1078
1079
1080
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1078

def _wkt_typename  # :nodoc:
  "COMPD_CS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis



1064
1065
1066
1067
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1064

def get_axis(index_)
  hd_ = @head.dimension
  index_ < hd_ ? @head.get_axis(index_) : @tail.get_axis(index_ - hd_)
end

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units



1072
1073
1074
1075
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1072

def get_units(index_)
  hd_ = @head.dimension
  index_ < hd_ ? @head.get_units(index_) : @tail.get_units(index_ - hd_)
end