Class: RGeo::CoordSys::CS::CompoundCoordinateSystem
- Inherits:
-
CoordinateSystem
- Object
- Base
- Info
- CoordinateSystem
- RGeo::CoordSys::CS::CompoundCoordinateSystem
- 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
-
#head ⇒ Object
readonly
Gets first sub-coordinate system.
-
#tail ⇒ Object
readonly
Gets second sub-coordinate system.
Attributes inherited from CoordinateSystem
Attributes inherited from Info
#abbreviation, #alias, #authority, #authority_code, #name, #remarks
Class Method Summary collapse
-
.create(name, head, tail, *optional) ⇒ Object
Create a CompoundCoordinateSystem given two sub-coordinate systems.
Instance Method Summary collapse
-
#get_axis(index) ⇒ Object
Implements CoordinateSystem#get_axis.
-
#get_units(index) ⇒ Object
Implements CoordinateSystem#get_units.
-
#initialize(name, head, tail, *optional) ⇒ CompoundCoordinateSystem
constructor
:nodoc:.
- #wkt_typename ⇒ Object
Methods inherited from CoordinateSystem
create_from_wkt, #geographic?, #projected?, #transform_coords
Methods inherited from Info
Methods inherited from Base
#encode_with, #eql?, #hash, #init_with, #inspect, #marshal_dump, #marshal_load, #to_s, #to_wkt
Constructor Details
#initialize(name, head, tail, *optional) ⇒ CompoundCoordinateSystem
:nodoc:
984 985 986 987 988 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 984 def initialize(name, head, tail, *optional) # :nodoc: super(name, head.dimension + tail.dimension, *optional) @head = head @tail = tail end |
Instance Attribute Details
#head ⇒ Object (readonly)
Gets first sub-coordinate system.
991 992 993 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 991 def head @head end |
#tail ⇒ Object (readonly)
Gets second sub-coordinate system.
994 995 996 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 994 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.
1019 1020 1021 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1019 def create(name, head, tail, *optional) new(name, head, tail, *optional) end |
Instance Method Details
#get_axis(index) ⇒ Object
Implements CoordinateSystem#get_axis
998 999 1000 1001 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 998 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
1005 1006 1007 1008 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1005 def get_units(index) hd = @head.dimension index < hd ? @head.get_units(index) : @tail.get_units(index - hd) end |
#wkt_typename ⇒ Object
1010 1011 1012 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1010 def wkt_typename "COMPD_CS" end |