Unit

class geodetic_engine.units.Unit[source]

Bases: object

A length or angle unit, as si = scale * value.

symbol

Its symbol, as given or as its payload states it.

quantity

"length" or "angle".

scale

SI units per unit: metres, or radians.

payload

The persistableReference it was read from, to be written back unchanged, or None. Not compared.

Raises:

UnitError – If quantity is neither, or scale is not a finite positive number.

to_si(value)[source]

A value in this unit, in metres or radians.

Return type:

float

from_si(value)[source]

A value in metres or radians, in this unit.

Return type:

float

reference()[source]

The unit as an OSDU unit persistableReference.

The payload it was read from, if any. Otherwise a USO payload in the form the OSDU CRS conversion service writes: for metres, exactly the service’s own.

Return type:

str

__init__(symbol, quantity, scale, payload=None)