class RGeo::CoordSys::CS::Base

This is a base class for all OGC coordinate system objects. This includes both interfaces and data types from the OGC Coordinate Transformation spec.

This is a non-instantiable abstract class.

Public Instance Methods

==(rhs_) click to toggle source
Alias for: eql?
eql?(rhs_) click to toggle source

Tests for equality. Two objects are defined as equal if they have the same type (class) and the same WKT representation.

# File lib/rgeo/coord_sys/cs/entities.rb, line 191
def eql?(rhs_)
  rhs_.class == self.class && rhs_.to_wkt == self.to_wkt
end
Also aliased as: ==
hash() click to toggle source

Standard hash code

# File lib/rgeo/coord_sys/cs/entities.rb, line 199
def hash
  @hash ||= self.to_wkt.hash
end
inspect() click to toggle source

Standard object inspection output

# File lib/rgeo/coord_sys/cs/entities.rb, line 183
def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)} #{to_wkt}>"
end
to_s() click to toggle source

Returns the default WKT representation.

# File lib/rgeo/coord_sys/cs/entities.rb, line 206
def to_s
  to_wkt
end
to_wkt(opts_={}) click to toggle source

Computes the WKT representation. Options include:

:standard_brackets

If set to true, outputs parentheses rather than square brackets. Default is false.

# File lib/rgeo/coord_sys/cs/entities.rb, line 217
def to_wkt(opts_={})
  if opts_[:standard_brackets]
    @standard_wkt ||= _to_wkt('(', ')')
  else
    @square_wkt ||= _to_wkt('[', ']')
  end
end