Class: RGeo::CoordSys::CS::GeographicCoordinateSystem
- Inherits:
-
HorizontalCoordinateSystem
- Object
- Base
- Info
- CoordinateSystem
- HorizontalCoordinateSystem
- RGeo::CoordSys::CS::GeographicCoordinateSystem
- Defined in:
- lib/rgeo/coord_sys/cs/entities.rb
Overview
OGC spec description
A coordinate system based on latitude and longitude. Some geographic coordinate systems are Lat/Lon, and some are Lon/Lat. You can find out which this is by examining the axes. You should also check the angular units, since not all geographic coordinate systems use degrees.
Instance Attribute Summary collapse
-
#angular_unit ⇒ Object
readonly
Returns the AngularUnit.
-
#prime_meridian ⇒ Object
readonly
Returns the PrimeMeridian.
Attributes inherited from HorizontalCoordinateSystem
Attributes inherited from CoordinateSystem
Attributes inherited from Info
#abbreviation, #alias, #authority, #authority_code, #name, #remarks
Class Method Summary collapse
-
.create(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) ⇒ Object
Create a GeographicCoordinateSystem, given a name, an AngularUnit, a HorizontalDatum, a PrimeMeridian, and two 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.
-
#get_wgs84_conversion_info(_index_) ⇒ Object
Gets details on a conversion to WGS84.
-
#initialize(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) ⇒ GeographicCoordinateSystem
constructor
:nodoc:.
-
#num_conversion_to_wgs84 ⇒ Object
Gets the number of available conversions to WGS84 coordinates.
Methods inherited from Info
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_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) ⇒ GeographicCoordinateSystem
:nodoc:
1185 1186 1187 1188 1189 1190 1191 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1185 def initialize(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) # :nodoc: super(name_, horizontal_datum_, *optional_) @prime_meridian = prime_meridian_ @angular_unit = angular_unit_ @axis0 = axis0_ @axis1 = axis1_ end |
Instance Attribute Details
#angular_unit ⇒ Object (readonly)
Returns the AngularUnit. The angular unit must be the same as the CS_CoordinateSystem units.
1198 1199 1200 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1198 def angular_unit @angular_unit end |
#prime_meridian ⇒ Object (readonly)
Returns the PrimeMeridian.
1194 1195 1196 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1194 def prime_meridian @prime_meridian end |
Class Method Details
.create(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) ⇒ Object
Create a GeographicCoordinateSystem, given a name, an AngularUnit, a HorizontalDatum, a PrimeMeridian, and two AxisInfo objects. The AxisInfo objects are optional and may be set to nil. You may also provide the optional parameters specified by the Info interface.
1246 1247 1248 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1246 def create(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) new(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) end |
Instance Method Details
#_wkt_content(open_, close_) ⇒ Object
:nodoc:
1232 1233 1234 1235 1236 1237 |
# 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_), @angular_unit._to_wkt(open_, close_)] arr_ << @axis0._to_wkt(open_, close_) if @axis0 arr_ << @axis1._to_wkt(open_, close_) if @axis1 arr_ end |
#_wkt_typename ⇒ Object
:nodoc:
1228 1229 1230 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1228 def _wkt_typename # :nodoc: "GEOGCS" end |
#get_axis(index_) ⇒ Object
Implements CoordinateSystem#get_axis
1208 1209 1210 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1208 def get_axis(index_) index_ == 1 ? @axis1 : @axis0 end |
#get_units(_index_) ⇒ Object
Implements CoordinateSystem#get_units
1202 1203 1204 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1202 def get_units(_index_) @angular_unit end |
#get_wgs84_conversion_info(_index_) ⇒ Object
Gets details on a conversion to WGS84. Some geographic coordinate systems provide several transformations into WGS84, which are designed to provide good accuracy in different areas of interest. The first conversion (with index=0) should provide acceptable accuracy over the largest possible area of interest.
1224 1225 1226 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1224 def get_wgs84_conversion_info(_index_) @horizontal_datum.wgs84_parameters end |
#num_conversion_to_wgs84 ⇒ Object
Gets the number of available conversions to WGS84 coordinates.
1214 1215 1216 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1214 def num_conversion_to_wgs84 @horizontal_datum.wgs84_parameters ? 1 : 0 end |