OperationRequest¶
- class geodetic_engine.geodesy.OperationRequest[source]¶
Bases:
objectA caller’s request for a particular coordinate operation.
Either an authority code or a name, never a substring of either – or the operation itself, when a payload stated it outright rather than naming it.
- text¶
The reference as the caller wrote it.
- auth_name¶
Authority, when the reference is an authority code.
- code¶
Code, when the reference is an authority code.
- name¶
Operation name, when the reference is not an authority code.
- definition¶
The operation itself, when it was stated rather than named. Excluded from equality so that a request stays hashable whatever PROJ’s own objects do.
- classmethod stated(operation)[source]¶
A request for an operation supplied outright.
No authority code is recorded even when the definition carries one: the code would invite a lookup, and what has to be applied is this object, whose parameters need not agree with whatever a register publishes under the same code.
- Return type:
- classmethod parse(reference)[source]¶
Parse an operation reference.
- Parameters:
reference (
str|int|OperationCandidate|StatedOperation) –"EPSG:15670", a bare EPSG code such as15670, an OGC URN such as"urn:ogc:def:coordinateOperation:EPSG::15670", an operation name such as"ITRF2014 to ETRF2014 (1)", anOperationCandidatefromavailable_operations()(itsauthority_codeis used when it has one, its name otherwise – the latter is the only way to pin down a candidate PROJ built with no EPSG id of its own), or an operation stated outright: an OSDU persistableReference payload, an ESRIGEOGTRAN, or anything that builds one throughStatedOperation. A stated operation is applied as given rather than looked up.- Return type:
- Returns:
The parsed request.
- Raises:
ValueError – If given an
OperationCandidatethat no single reference can name, because PROJ assembled it from operations no authority publishes as one. Useparse_operations, which expands it. Or if a payload states no usable operation.
Example
>>> OperationRequest.parse("EPSG:15670").code '15670' >>> OperationRequest.parse("ITRF2014 to ETRF2014 (1)").name 'ITRF2014 to ETRF2014 (1)'
- find_in(definition)[source]¶
Locate this operation within a PROJJSON operation tree.
Normalising axis order makes PROJ wrap the requested operation in a concatenated operation. That wrapper is often given the same identifier as the step it wraps, but PROJ also renames it, appending “(with axis order normalized for visualization)” to its name. Walking the tree in document order therefore meets the polluted wrapper name before the clean name on the step itself, so the last matching node is kept rather than the first: the wrapper can only repeat an identifier that a deeper, more specific node already carries.
A step that needs to touch only part of a compound target CRS (a vertical shift folded into a horizontal+vertical compound, for example) cannot be looked up as the registered operation as-is, so PROJ rebuilds it as an unidentified “PROJ-based operation method” and drops its id. Its name survives that rebuild – plain, or prefixed with “Inverse of” when applied in the reverse direction – so a request by code also falls back to matching by that code’s registered name.
- is_satisfied_by(definition)[source]¶
Whether a PROJJSON operation tree really contains this operation.
- __init__(text, auth_name, code, name, definition=None)¶