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:



1257
1258
1259
1260
1261
1262
1263
1264
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1257

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.



1267
1268
1269
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1267

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.



1274
1275
1276
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1274

def linear_unit
  @linear_unit
end

#projectionObject (readonly)

Gets the projection.



1270
1271
1272
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1270

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.



1308
1309
1310
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1308

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:



1292
1293
1294
1295
1296
1297
1298
1299
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1292

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:



1288
1289
1290
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1288

def _wkt_typename # :nodoc:
  "PROJCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis



1284
1285
1286
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1284

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

#get_units(_index_) ⇒ Object

Implements CoordinateSystem#get_units



1278
1279
1280
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1278

def get_units(_index_)
  @linear_unit
end