UnitEntry

class geodetic_engine.catalog.UnitEntry[source]

Bases: RegistryEntry

A unit of measure the active database holds.

Listed by units(), from pyproj.database.get_units_map().

For reading a length or angle unit an OSDU payload states, geodetic_engine.units is the module to use; this lists what PROJ knows.

kind

What the unit measures.

conversion_factor

Multiplier to the SI unit of the same quantity: metres, radians, unity or seconds. None for a unit that is no plain multiple, such as EPSG’s sexagesimal degrees.

proj_short_name

PROJ’s own short name for the unit, as a PROJ string writes it ("us-ft"), or None.

__init__(*, auth_name, code, name, deprecated, aliases=(), replaced_by=(), kind, conversion_factor, proj_short_name=None)
property projjson_type: str

"LinearUnit", "AngularUnit", "ScaleUnit" and so on.

to_json_dict()[source]

The unit as PROJJSON’s unit object, with its id.

PROJ exports a unit only inside another object, so this is the form it writes there. It has no $schema: PROJJSON’s schema does not admit a unit as a document of its own.

Return type:

dict[str, Any]

Example

>>> from geodetic_engine import catalog
>>> foot = catalog.units(code="EPSG:9003").one().to_json_dict()
>>> foot["type"], foot["name"], foot["id"]
('LinearUnit', 'US survey foot', {'authority': 'EPSG', 'code': 9003})