length_unit

geodetic_engine.units.length_unit(value)[source]

Read a length unit.

Parameters:

value (str) – A symbol or name in any case, such as "ft" or "metre"; an OSDU UnitOfMeasure record id, URL-encoded or not, such as "osdu:reference-data--UnitOfMeasure:ft:"; or an OSDU unit persistableReference, USO or UAD.

Raises:

UnitError – If value is none of these or not a length, or is a payload converting with an offset, by a rational polynomial, or by a scale that is not finite and positive.

Example

Return type:

Unit

>>> length_unit("ftUS").scale == 1200 / 3937
True