Source code for shapelib.exceptions.transformation_exceptions
[docs]
class DatumTransformationError(ValueError):
"""
Exception raised when coordinates cannot be transformed with the best accuracy known.
shapelib only transforms coordinates with the best transformation PROJ knows
between two CRSs. It refuses to fall back to a less accurate one — such as a
formula used when the official correction grid is not installed, or a
"ballpark" transformation that ignores the datum shift when the datum is
unknown — because a fallback moves the data by metres without any warning.
Subclasses ``ValueError``, so code that already catches ``ValueError`` for
CRS problems keeps working.
Examples
--------
>>> try:
... lines = read_file("nad27_lines.shp") # NAD27 needs a US grid not bundled
... except DatumTransformationError as error:
... print(error)
"""