Class: Proj::CoordinateMetadata

Inherits:
PjObject
  • Object
show all
Defined in:
lib/proj/coordinate_metadata.rb

Overview

Coordinate metadata is the information required to make coordinates unambiguous. For a coordinate set referenced to a static CRS it is the CRS definition. For a coordinate set referenced to a dynamic CRS it is the CRS definition together with the coordinate epoch of the coordinates in the coordinate set.

In a dynamic CRS, coordinates of a point on the surface of the Earth may change with time. To be unambiguous the coordinates must always be qualified with the epoch at which they are valid. The coordinate epoch is not necessarily the epoch at which the observation was collected.

Instance Method Summary collapse

Methods inherited from PjObject

#accuracy, #angular_input?, #angular_output?, #area_of_use, #auth, #auth_name, #context, #context=, create, create_from_database, create_from_name, create_from_wkt, #definition, #degree_input?, #degree_output?, #deprecated?, #description, #equivalent_to?, #errno, #errorno, #factors, #geod_distance, #has_inverse?, #id, #id_code, #info, #initialize_copy, #lp_distance, #lpz_distance, #name, #non_deprecated, #proj_type, #remarks, #scope, #source_crs, #target_crs, #to_json, #to_proj_string, #to_ptr, #to_s, #to_wkt, #xy_distance, #xyz_distance

Constructor Details

#initialize(crs, context = nil, epoch = nil) ⇒ CoordinateMetadata

Create a CoordinateMetadata object

Parameters:

  • crs (Crs)

    The associated Crs

  • context (Context) (defaults to: nil)

    . An optional Context

  • epoch (Double) (defaults to: nil)

    . Epoch at wich the CRS is valid



21
22
23
24
25
26
27
28
29
# File 'lib/proj/coordinate_metadata.rb', line 21

def initialize(crs, context=nil, epoch=nil)
  ptr = Api.(context || Context.current, crs, epoch)

  if ptr.null?
    Error.check_object(self)
  end

  super(ptr, context)
end

Instance Method Details

#epochDouble

Returns the coordinate epoch

Returns:

  • (Double)


34
35
36
# File 'lib/proj/coordinate_metadata.rb', line 34

def epoch
  Api.(self.context, self)
end