Errors and per-point statuses#
A batch error rejects a request or reports an execution failure. A successful request can still contain rows that could not be transformed. Check the batch result first, then check each row before using its coordinate.
Which error rejected the request?#
All Python exceptions in this table derive from CugeoProjError. The value errors also derive from ValueError. The other built-in base classes are shown in the table. C++ reports these codes through cugeo::proj::error, whose code() is the corresponding lowercase cugeo::proj::error_code member. They are codes on one C++ exception type, rather than separate C++ exception classes.
C ABI status |
Code |
Python exception and built-in base |
C++ code |
Meaning |
|---|---|---|---|---|
|
0 |
Returns normally |
|
The batch request succeeded. Inspect row statuses for individual failures. |
|
1 |
|
|
An argument or descriptor is invalid. Check the call and its inputs. |
|
2 |
|
|
The request is valid but this release cannot execute it. This includes a valid unsupported CRS pair and a saved grid digest that cannot be reproduced. |
|
3 |
|
|
PROJ failed, including when its database is unavailable. |
|
4 |
|
|
A native buffer descriptor is invalid or too small. Check its size and layout, including any cause buffer. |
|
5 |
|
|
Another execution still owns the workspace. Complete and release that execution before reuse. |
|
6 |
|
|
The requested CUDA execution lane is unavailable. |
|
7 |
|
|
CUDA reported a launch or asynchronous execution failure. |
|
8 |
|
|
The requested operation is incompatible with stream capture. |
|
9 |
|
|
PROJ refused a CRS definition. Check the definition and runtime. |
|
10 |
|
|
A required grid or resource directory is absent, including a grid removed after selection. |
|
11 |
|
|
The operation requires a newer runtime PROJ. |
|
12 |
|
|
CUDA device allocation was exhausted. |
|
13 |
|
|
Known host preparation storage exceeds an explicit admission cap. |
|
255 |
|
|
A host fault occurred, including unavailable decoded-grid storage or a refused host allocation. |
The C error contains abi_size, code, and a bounded message. Python decodes the message through the first NUL as UTF-8, replacing invalid sequences. It maps an unrecognized status to InternalError and does not add fallback text. C++ exposes the native message through what(), or cugeo-proj call failed when that message is empty. Message wording can vary, so use the code for programmatic handling. See the C ABI codes, Python mapping, and C++ error wrapper.
An undersized native cause buffer is a request error. The error does not indicate a row failure. In the checked rejection cases, validation returns before producing an execution and leaves every output buffer byte-for-byte unchanged. More generally, after a failed native enqueue, check whether it returned a non-NULL cleanup handle and release it before reusing borrowed resources.
Can I use this coordinate?#
Only an OK row supplies a usable position. RowStatus and RowFailure are separate byte-valued lookups.
|
Byte |
Coordinate implication |
|---|---|---|
|
0 |
The position is usable. |
|
1 |
Input is null. Do not use the position. |
|
2 |
Input is invalid. Do not use the position. |
|
3 |
The row is outside an admitted domain or limit. Do not use the position. |
|
4 |
The calculation failed numerically. Do not use the position. |
|
Byte |
Meaning and associated status |
|---|---|---|
|
0 |
No failure cause. Used for |
|
1 |
Invalid input. Associated with |
|
2 |
Outside the selected operation’s domain. Associated with |
|
3 |
Outside a grid’s extent. Associated with |
|
4 |
A grid has no data at the position. Associated with |
|
5 |
Numerical failure. Associated with |
|
6 |
Outside an implementation fence or a narrower selected-operation guard. Associated with |
For OUT_OF_DOMAIN, inspect the cause to distinguish the selected operation’s domain, grid extent, grid nodata, and implementation limits. Once you have the code, use Diagnose a refused transform or failed coordinate to investigate the CRS, grid, or coordinate.
Transformer.transform() and transform_device() return coordinate arrays first, followed by statuses when return_status=True, then causes when return_failures=True. On the host, an input mask and explicit validity intersect. For enqueue_device(), request return_failures=True to compute causes and retrieve outputs through the returned execution’s completion methods. In the checked 2D UTM, Web Mercator, and composed cases, requesting a cause byte per row preserves coordinate bits, validity, and status. See the transformer implementation and row diagnostic tests.