Class: RGeo::CoordSys::CS::LocalCoordinateSystem

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

Overview

OGC spec description

A local coordinate system, with uncertain relationship to the world. In general, a local coordinate system cannot be related to other coordinate systems. However, if two objects supporting this interface have the same dimension, axes, units and datum then client code is permitted to assume that the two coordinate systems are identical. This allows several datasets from a common source (e.g. a CAD system) to be overlaid. In addition, some implementations of the Coordinate Transformation (CT) package may have a mechanism for correlating local datums. (E.g. from a database of transformations, which is created and maintained from real-world measurements.)

Notes

RGeo's implementation does not provide the Coordinate Transformation (CT) package.

Instance Attribute Summary collapse

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

#encode_with, #eql?, #hash, #init_with, #inspect, #marshal_dump, #marshal_load, #to_s, #to_wkt

Constructor Details

#initialize(name, local_datum, unit, axes, *optional) ⇒ LocalCoordinateSystem

:nodoc:


1012
1013
1014
1015
1016
1017
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1012

def initialize(name, local_datum, unit, axes, *optional) # :nodoc:
  super(name, axes.size, *optional)
  @local_datum = local_datum
  @unit = unit
  @axes = axes.dup
end

Instance Attribute Details

#local_datumObject (readonly)

Gets the local datum.


1020
1021
1022
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1020

def local_datum
  @local_datum
end

Class Method Details

.create(name, local_datum, unit, axes, *optional) ⇒ Object

Create a LocalCoordinateSystem given a name, a LocalDatum, a Unit, and an array of at least one AxisInfo. You may also provide the optional parameters specified by the Info interface.


1044
1045
1046
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1044

def create(name, local_datum, unit, axes, *optional)
  new(name, local_datum, unit, axes, *optional)
end

Instance Method Details

#get_axis(index) ⇒ Object

Implements CoordinateSystem#get_axis


1024
1025
1026
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1024

def get_axis(index)
  @axes[index]
end

#get_units(index) ⇒ Object

Implements CoordinateSystem#get_units


1030
1031
1032
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1030

def get_units(index)
  @unit
end

#wkt_typenameObject


1034
1035
1036
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1034

def wkt_typename
  "LOCAL_CS"
end