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
- #geographic? ⇒ Boolean
-
#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.
- #wkt_typename ⇒ Object
Methods inherited from CoordinateSystem
create_from_wkt, #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, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional) ⇒ GeographicCoordinateSystem
:nodoc:
1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1260 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.
1273 1274 1275 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1273 def angular_unit @angular_unit end |
#prime_meridian ⇒ Object (readonly)
Returns the PrimeMeridian.
1269 1270 1271 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1269 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.
1318 1319 1320 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1318 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
#geographic? ⇒ Boolean
1303 1304 1305 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1303 def geographic? true end |
#get_axis(index) ⇒ Object
Implements CoordinateSystem#get_axis
1283 1284 1285 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1283 def get_axis(index) index == 1 ? @axis1 : @axis0 end |
#get_units(_index) ⇒ Object
Implements CoordinateSystem#get_units
1277 1278 1279 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1277 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.
1299 1300 1301 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1299 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.
1289 1290 1291 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1289 def num_conversion_to_wgs84 @horizontal_datum.wgs84_parameters ? 1 : 0 end |
#wkt_typename ⇒ Object
1307 1308 1309 |
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1307 def wkt_typename "GEOGCS" end |