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 CoordinateSystem

create_from_wkt, #geographic?, #transform_coords

Methods inherited from Info

#extension

Methods inherited from Base

#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:



1345
1346
1347
1348
1349
1350
1351
1352
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1345

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.



1355
1356
1357
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1355

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.



1362
1363
1364
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1362

def linear_unit
  @linear_unit
end

#projectionObject (readonly)

Gets the projection.



1358
1359
1360
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1358

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.



1391
1392
1393
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1391

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

#get_axis(index) ⇒ Object

Implements CoordinateSystem#get_axis



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

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

#get_units(_index) ⇒ Object

Implements CoordinateSystem#get_units



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

def get_units(_index)
  @linear_unit
end

#projected?Boolean

Returns:

  • (Boolean)


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

def projected?
  true
end

#wkt_typenameObject



1380
1381
1382
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1380

def wkt_typename
  "PROJCS"
end