pretty_persistable_reference¶
- geodetic_engine.persistablereference.pretty_persistable_reference(payload, *, indent=2, wkt=False)[source]¶
Lay a persistableReference out for reading.
By default the result is the reference’s JSON, indented, with its members in the order the payload states them and each WKT a single string, so it is still JSON. With
wkteach embedded ESRI WKT is laid out over indented lines beneath its key as well. Only whitespace changes either way, but the second is no longer JSON: it is for reading, and the verbatim payload is what to store or send.- Parameters:
- Return type:
- Returns:
The laid-out text.
- Raises:
MalformedReferenceError – If the payload is not a JSON object.
Example
>>> print(pretty_persistable_reference( ... '{"type":"LBC","wkt":"GEOGCS[\\"a\\",DATUM[\\"b\\",' ... 'SPHEROID[\\"c\\",1.0,2.0]]]"}', ... wkt=True, ... )) { "type": "LBC", "wkt": GEOGCS["a", DATUM["b", SPHEROID["c",1.0,2.0]]] }