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

:nodoc:


1115
1116
1117
1118
1119
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1115

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.


1123
1124
1125
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1123

def head
  @head
end

#tailObject (readonly)

Gets second sub-coordinate system.


1126
1127
1128
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1126

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.


1161
1162
1163
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1161

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

Instance Method Details

#_wkt_content(open_, close_) ⇒ Object

:nodoc:


1149
1150
1151
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1149

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

#_wkt_typenameObject

:nodoc:


1145
1146
1147
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1145

def _wkt_typename  # :nodoc:
  "COMPD_CS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis


1131
1132
1133
1134
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1131

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


1139
1140
1141
1142
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1139

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