AppliedOperation

class geodetic_engine.geodesy.AppliedOperation[source]

Bases: object

Which coordinate operation was applied, against which was requested.

requested

The operation reference the caller asked for, or None.

auth_name

Authority of the operation applied, for example "EPSG".

code

Code of the operation applied, for example "15670".

name

Name of the operation applied.

method_name

Name of the operation method, when it is a single step.

accuracy

Stated accuracy in metres, or None when PROJ reports none.

route

How the transformer was arrived at.

ballpark

Whether the applied operation is a ballpark approximation.

requires_epoch

Whether the applied operation reads the coordinate epoch.

steps

Names of the individual steps, for a concatenated operation.

execution_direction

Direction the raw operation definition is executed in, separate from any inversions already embedded by PROJ.

bound_operations

References of the operations the CRSs themselves declared, when the route is OperationRoute.BOUND. One entry for a single bound CRS, two when both CRSs were bound – in which case the chain has no single code and authority_code is None, but neither operation was chosen by PROJ. Empty on every other route. Not requested: the caller named neither.

axis_order_corrected

Whether the pipeline PROJ built from projjson transposes coordinates at an engineering CRS or an evaluation point, so that this package ran a corrected pipeline instead. When True, to_wkt() returns None and projjson must not be replayed through PROJ; replay pipeline.

projjson: str

PROJJSON of the operation applied.

Raw, so it is present even when to_wkt() returns None because a step is applied inverted or axis_order_corrected is True. Feeding it back to PROJ in those cases silently applies that step forwards, or reproduces the transposition this package corrected; prefer pipeline, which is what actually ran.

property authority_code: str | None

"AUTH:CODE" of the applied operation, or None if unidentified.

to_wkt(*, pretty=False)[source]

Export the operation that was applied as WKT2.

Rendered from what PROJ built rather than looked up by code, so it also works for an operation the EPSG dataset does not define, such as a concatenated chain collapsed into one step. The consequence is that the registry’s descriptive metadata is not present: expect the method, parameters and ID of the operation, but no VERSION, USAGE or REMARK. Read the parameters from here; read the scope and area of validity from the EPSG dataset via authority_code.

Parameters:

pretty (bool, default: False) – Whether to indent the output over several lines.

Return type:

str | None

Returns:

The WKT2 of the applied operation, or None where it cannot be exported faithfully: either PROJ built something that is not a coordinate operation in its own right, or a step is applied inverted and WKT2 cannot say so (see has_inverted_step). Also returns None when the raw definition was executed in reverse, or when axis_order_corrected is True, since PROJ would run the exported operation with the axis order this package had to correct. Use TransformationResult.pipeline in those cases, which states what actually ran.

Example

>>> from geodetic_engine.geodesy import Transformation
>>> tfm = Transformation("EPSG:4230", "EPSG:4326", operation="EPSG:1133")
>>> tfm.operation.to_wkt()[:19]
'COORDINATEOPERATION'
__init__(requested, auth_name, code, name, method_name, accuracy, route, ballpark=False, requires_epoch=False, steps=(), projjson='', execution_direction=TransformDirection.FORWARD, bound_operations=(), axis_order_corrected=False)