CrsReference¶
- class geodetic_engine.persistablereference.CrsReference[source]¶
Bases:
ReferenceA coordinate reference system, on its own or bound to a hub.
- wkt¶
The ESRI WKT of the CRS itself. For a bound reference this is the nested late bound CRS’s WKT when supplied, regardless of any top-level WKT.
- late_bound¶
The CRS being bound, when this reference binds one.
- operation¶
The transformation it is bound by, when it binds one.
- to_crs()[source]¶
Build the CRS this reference states.
- Return type:
- Returns:
The CRS, as a
BoundCRSwhen the reference binds a transformation to it.- Raises:
MalformedReferenceError – If the reference states no WKT, or PROJ will not read it, or the bound operation’s source CRS does not match the base geodetic CRS.
UnsupportedMethodError – If the bound transformation states a method this package will not translate.
UnembeddableOperationError – If the bound transformation cannot be stated as the single step a bound CRS carries.
- to_bound_crs(operation)[source]¶
Build this CRS bound to a transformation stated by a separate payload.
An OSDU catalogue publishes a CRS and a coordinate transformation as records of their own, and a record that uses them names both. Binding them here gives the same thing an early bound payload states in one piece: a CRS that carries its own datum shift, leaving nothing for a caller to disambiguate later.
- Parameters:
operation (
OperationReference) – The transformation to bind, asparse_persistable_reference()returns for anSTorCTpayload. A parsed reference is the only thing accepted. An authority code, a CRS name or PROJJSON would each have to be resolved against a register, and this package reads the parameters a payload carries rather than looking up what a code is meant to stand for.- Return type:
- Returns:
The bound CRS.
- Raises:
ValueError – If this reference already states a transformation of its own. Binding a second would discard the first in silence.
MalformedReferenceError – If the operation’s source CRS does not match this CRS’s geodetic base (ignoring axis order), or PROJ will not assemble the two. Reversed operations must be explicitly inverted before binding.
UnsupportedMethodError – If the transformation states a method this package will not translate.
UnembeddableOperationError – If it cannot be stated as the single step a bound CRS carries.
Example
>>> crs = parse_persistable_reference(crs_payload) >>> shift = parse_persistable_reference(ct_payload) >>> crs.to_bound_crs(shift).is_bound True
- __init__(raw, kind, name, authority_code, version, wkt, late_bound, operation)¶