to_persistable_reference¶
- geodetic_engine.persistablereference.to_persistable_reference(value, *, name='', authority=None, version='')[source]¶
Write a CRS or transformation as a persistableReference payload.
- Parameters:
value (
CRS|CoordinateOperation) – The CRS to write, bound or not, or the transformation to write.name (
str, default:"") – Name to state, defaulting to the object’s own.authority (
AuthorityCode|None, default:None) – Authority code to stamp on the payload. Omitted by default: a code is a claim about a register, and this package will not make one on the caller’s behalf.version (
str, default:"") – Producer version to state. Omitted by default, because thePE_versions these payloads usually carry name a vendor’s projection engine release that this package is not.
- Return type:
- Returns:
The payload, as compact JSON.
- Raises:
UnsupportedMethodError – If a transformation states a method or parameter ESRI has no equivalent for.
UnsupportedReferenceError – If the object is one this dialect cannot state, such as a chain whose steps do not join.
MalformedReferenceError – If PROJ will not write the CRS as ESRI WKT.
Example
>>> from geodetic_engine.persistablereference import ( ... parse_persistable_reference, ... ) >>> payload = to_persistable_reference(CRS.from_epsg(23032)) >>> crs = parse_persistable_reference(payload).to_crs() >>> crs.equals(CRS.from_epsg(23032), ignore_axis_order=True) True