Class: RGeo::CoordSys::CS::GeographicCoordinateSystem

Inherits:
HorizontalCoordinateSystem show all
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

Attributes inherited from HorizontalCoordinateSystem

#horizontal_datum

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 Base

#_to_wkt, #eql?, #inspect, #to_s, #to_wkt

Constructor Details

#initialize(name_, angular_unit_, horizontal_datum_, prime_meridian_, axis0_, axis1_, *optional_) ⇒ GeographicCoordinateSystem

:nodoc:



1363
1364
1365
1366
1367
1368
1369
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1363

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.



1377
1378
1379
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1377

def angular_unit
  @angular_unit
end

#prime_meridian ⇒ Object (readonly)

Returns the PrimeMeridian.



1373
1374
1375
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1373

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.



1433
1434
1435
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1433

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:



1416
1417
1418
1419
1420
1421
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1416

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:



1412
1413
1414
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1412

def _wkt_typename  # :nodoc:
  "GEOGCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis



1389
1390
1391
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1389

def get_axis(index_)
  index_ == 1 ? @axis1 : @axis0
end

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units



1382
1383
1384
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1382

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.



1407
1408
1409
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1407

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.



1396
1397
1398
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1396

def num_conversion_to_wgs84
  @horizontal_datum.wgs84_parameters ? 1 : 0
end