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

:nodoc:


1517
1518
1519
1520
1521
1522
1523
1524
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1517

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.


1528
1529
1530
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1528

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.


1535
1536
1537
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1535

def linear_unit
  @linear_unit
end

#projectionObject (readonly)

Gets the projection.


1531
1532
1533
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1531

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.


1575
1576
1577
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1575

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:


1556
1557
1558
1559
1560
1561
1562
1563
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1556

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:


1552
1553
1554
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1552

def _wkt_typename  # :nodoc:
  "PROJCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis


1547
1548
1549
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1547

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

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units


1540
1541
1542
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1540

def get_units(index_)
  @linear_unit
end