Class: RGeo::CoordSys::CS::GeocentricCoordinateSystem
- Inherits:
-
CoordinateSystem
- Object
- Base
- Info
- CoordinateSystem
- RGeo::CoordSys::CS::GeocentricCoordinateSystem
- Defined in:
- lib/rgeo/coord_sys/cs/entities.rb
Overview
OGC spec description
A 3D coordinate system, with its origin at the centre of the Earth. The X axis points towards the prime meridian. The Y axis points East or West. The Z axis points North or South. By default the Z axis will point North, and the Y axis will point East (e.g. a right handed system), but you should check the axes for non-default values.
Instance Attribute Summary collapse
-
#horizontal_datum ⇒ Object
readonly
Returns the HorizontalDatum.
-
#linear_unit ⇒ Object
readonly
Gets the units used along all the axes.
-
#prime_meridian ⇒ Object
readonly
Returns the PrimeMeridian.
Attributes inherited from CoordinateSystem
Attributes inherited from Info
#abbreviation, #alias, #authority, #authority_code, #name, #remarks
Class Method Summary collapse
-
.create(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) ⇒ Object
Create a GeocentricCoordinateSystem given a name, a HorizontalDatum, a PrimeMeridian, a LinearUnit, and three AxisInfo objects.
Instance Method Summary collapse
-
#_wkt_content(open_, close_) ⇒ Object
:nodoc:.
-
#_wkt_typename ⇒ Object
:nodoc:.
-
#get_axis(index_) ⇒ Object
Implements CoordinateSystem#get_axis.
-
#get_units(index_) ⇒ Object
Implements CoordinateSystem#get_units.
-
#initialize(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) ⇒ GeocentricCoordinateSystem
constructor
:nodoc:.
Methods inherited from Base
#_to_wkt, #eql?, #inspect, #to_s, #to_wkt
Constructor Details
#initialize(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) ⇒ GeocentricCoordinateSystem
:nodoc:
1190 1191 1192 1193 1194 1195 1196 1197 1198 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1190 def initialize(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) # :nodoc: super(name_, 3, *optional_) @horizontal_datum = horizontal_datum_ @prime_meridian = prime_meridian_ @linear_unit = linear_unit_ @axis0 = axis0_ @axis1 = axis1_ @axis2 = axis2_ end |
Instance Attribute Details
#horizontal_datum ⇒ Object (readonly)
Returns the HorizontalDatum. The horizontal datum is used to determine where the centre of the Earth is considered to be. All coordinate points will be measured from the centre of the Earth, and not the surface.
1205 1206 1207 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1205 def horizontal_datum @horizontal_datum end |
#linear_unit ⇒ Object (readonly)
Gets the units used along all the axes.
1211 1212 1213 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1211 def linear_unit @linear_unit end |
#prime_meridian ⇒ Object (readonly)
Returns the PrimeMeridian.
1208 1209 1210 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1208 def prime_meridian @prime_meridian end |
Class Method Details
.create(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) ⇒ Object
Create a GeocentricCoordinateSystem given a name, a HorizontalDatum, a PrimeMeridian, a LinearUnit, and three AxisInfo objects. The AxisInfo are optional and may be nil. You may also provide the optional parameters specified by the Info interface.
1250 1251 1252 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1250 def create(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) new(name_, horizontal_datum_, prime_meridian_, linear_unit_, axis0_, axis1_, axis2_, *optional_) end |
Instance Method Details
#_wkt_content(open_, close_) ⇒ Object
:nodoc:
1232 1233 1234 1235 1236 1237 1238 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1232 def _wkt_content(open_, close_) # :nodoc: arr_ = [@horizontal_datum._to_wkt(open_, close_), @prime_meridian._to_wkt(open_, close_), @linear_unit._to_wkt(open_, close_)] arr_ << @axis0._to_wkt(open_, close_) if @axis0 arr_ << @axis1._to_wkt(open_, close_) if @axis1 arr_ << @axis2._to_wkt(open_, close_) if @axis2 arr_ end |
#_wkt_typename ⇒ Object
:nodoc:
1228 1229 1230 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1228 def _wkt_typename # :nodoc: "GEOCCS" end |
#get_axis(index_) ⇒ Object
Implements CoordinateSystem#get_axis
1223 1224 1225 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1223 def get_axis(index_) [@axis0, @axis1, @axis2][index_] end |
#get_units(index_) ⇒ Object
Implements CoordinateSystem#get_units
1216 1217 1218 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1216 def get_units(index_) @linear_unit end |