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

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


1193
1194
1195
1196
1197
1198
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1193

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.


1202
1203
1204
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1202

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.


1236
1237
1238
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1236

def create(name_, local_datum_, unit_, axes_, *optional_)
  new(name_, local_datum_, unit_, axes_, *optional_)
end

Instance Method Details

#_wkt_content(open_, close_) ⇒ Object

:nodoc:


1223
1224
1225
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1223

def _wkt_content(open_, close_)  # :nodoc:
  [@local_datum._to_wkt(open_, close_), @unit._to_wkt(open_, close_)] + @axes.map{ |ax_| ax_._to_wkt(open_, close_) }
end

#_wkt_typenameObject

:nodoc:


1219
1220
1221
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1219

def _wkt_typename  # :nodoc:
  "LOCAL_CS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis


1207
1208
1209
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1207

def get_axis(index_)
  @axes[index_]
end

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units


1214
1215
1216
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1214

def get_units(index_)
  @unit
end