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 Info

#extension

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:


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

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_unitObject (readonly)

Returns the AngularUnit. The angular unit must be the same as the CS_CoordinateSystem units.


1444
1445
1446
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1444

def angular_unit
  @angular_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.


1440
1441
1442
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1440

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.


1500
1501
1502
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1500

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:


1483
1484
1485
1486
1487
1488
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1483

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_typenameObject

:nodoc:


1479
1480
1481
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1479

def _wkt_typename  # :nodoc:
  "GEOGCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis


1456
1457
1458
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1456

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

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units


1449
1450
1451
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1449

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.


1474
1475
1476
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1474

def get_wgs84_conversion_info(index_)
  @horizontal_datum.wgs84_parameters
end

#num_conversion_to_wgs84Object

Gets the number of available conversions to WGS84 coordinates.


1463
1464
1465
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1463

def num_conversion_to_wgs84
  @horizontal_datum.wgs84_parameters ? 1 : 0
end