Class: RGeo::CoordSys::CS::ProjectedCoordinateSystem

Inherits:
HorizontalCoordinateSystem show all
Defined in:
lib/rgeo/coord_sys/cs/entities.rb

Overview

OGC spec description

A 2D cartographic coordinate system.

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_, geographic_coordinate_system_, projection_, linear_unit_, axis0_, axis1_, *optional_) ⇒ ProjectedCoordinateSystem

:nodoc:



1450
1451
1452
1453
1454
1455
1456
1457
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1450

def initialize(name_, geographic_coordinate_system_, projection_, linear_unit_, axis0_, axis1_, *optional_)  # :nodoc:
  super(name_, geographic_coordinate_system_.horizontal_datum, *optional_)
  @geographic_coordinate_system = geographic_coordinate_system_
  @projection = projection_
  @linear_unit = linear_unit_
  @axis0 = axis0_
  @axis1 = axis1_
end

Instance Attribute Details

#geographic_coordinate_systemObject (readonly)

Returns the GeographicCoordinateSystem.



1461
1462
1463
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1461

def geographic_coordinate_system
  @geographic_coordinate_system
end

#linear_unitObject (readonly)

Returns the LinearUnits. The linear unit must be the same as the CS_CoordinateSystem units.



1468
1469
1470
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1468

def linear_unit
  @linear_unit
end

#projectionObject (readonly)

Gets the projection.



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

def projection
  @projection
end

Class Method Details

.create(name_, geographic_coordinate_system_, projection_, linear_unit_, axis0_, axis1_, *optional_) ⇒ Object

Create a ProjectedCoordinateSystem given a name, a GeographicCoordinateSystem, and Projection, a LinearUnit, 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.



1508
1509
1510
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1508

def create(name_, geographic_coordinate_system_, projection_, linear_unit_, axis0_, axis1_, *optional_)
  new(name_, geographic_coordinate_system_, projection_, linear_unit_, axis0_, axis1_, *optional_)
end

Instance Method Details

#_wkt_content(open_, close_) ⇒ Object

:nodoc:



1489
1490
1491
1492
1493
1494
1495
1496
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1489

def _wkt_content(open_, close_)  # :nodoc:
  arr_ = [@geographic_coordinate_system._to_wkt(open_, close_), @projection._to_wkt(open_, close_)]
  @projection.each_parameter{ |param_| arr_ << param_._to_wkt(open_, close_) }
  arr_ << @linear_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:



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

def _wkt_typename  # :nodoc:
  "PROJCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis



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

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

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units



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

def get_units(index_)
  @linear_unit
end