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

CUGEO_PROJ_SUCCESS

0

Returns normally

success

The batch request succeeded. Inspect row statuses for individual failures.

CUGEO_PROJ_INVALID_ARGUMENT

1

InvalidArgumentError, ValueError

invalid_argument

An argument or descriptor is invalid. Check the call and its inputs.

CUGEO_PROJ_UNSUPPORTED

2

UnsupportedError, ValueError

unsupported

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.

CUGEO_PROJ_PROJ_ERROR

3

ProjError, ValueError

proj_error

PROJ failed, including when its database is unavailable.

CUGEO_PROJ_BUFFER_ERROR

4

BufferError, ValueError

buffer_error

A native buffer descriptor is invalid or too small. Check its size and layout, including any cause buffer.

CUGEO_PROJ_WORKSPACE_BUSY

5

WorkspaceBusyError, ValueError

workspace_busy

Another execution still owns the workspace. Complete and release that execution before reuse.

CUGEO_PROJ_CUDA_UNAVAILABLE

6

CudaUnavailableError, RuntimeError

cuda_unavailable

The requested CUDA execution lane is unavailable.

CUGEO_PROJ_CUDA_ERROR

7

CudaError, ValueError

cuda_error

CUDA reported a launch or asynchronous execution failure.

CUGEO_PROJ_CAPTURE_ERROR

8

CaptureError, ValueError

capture_error

The requested operation is incompatible with stream capture.

CUGEO_PROJ_INVALID_CRS

9

InvalidCrsError, ValueError

invalid_crs

PROJ refused a CRS definition. Check the definition and runtime.

CUGEO_PROJ_MISSING_RESOURCE

10

MissingResourceError, ValueError

missing_resource

A required grid or resource directory is absent, including a grid removed after selection.

CUGEO_PROJ_PROJ_VERSION_REQUIRED

11

ProjVersionRequiredError, ValueError

proj_version_required

The operation requires a newer runtime PROJ.

CUGEO_PROJ_OUT_OF_MEMORY

12

OutOfMemoryError, MemoryError

out_of_memory

CUDA device allocation was exhausted.

CUGEO_PROJ_RESOURCE_LIMIT

13

ResourceLimitError, MemoryError

resource_limit

Known host preparation storage exceeds an explicit admission cap.

CUGEO_PROJ_INTERNAL_ERROR

255

InternalError, ValueError

internal_error

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.

RowStatus

Byte

Coordinate implication

OK

0

The position is usable.

NULL_INPUT

1

Input is null. Do not use the position.

INVALID_INPUT

2

Input is invalid. Do not use the position.

OUT_OF_DOMAIN

3

The row is outside an admitted domain or limit. Do not use the position.

NUMERICAL_FAILURE

4

The calculation failed numerically. Do not use the position.

RowFailure

Byte

Meaning and associated status

NONE

0

No failure cause. Used for OK and NULL_INPUT.

INVALID_INPUT

1

Invalid input. Associated with INVALID_INPUT.

OUTSIDE_OPERATION_DOMAIN

2

Outside the selected operation’s domain. Associated with OUT_OF_DOMAIN.

OUTSIDE_GRID

3

Outside a grid’s extent. Associated with OUT_OF_DOMAIN and requires a grid stage.

GRID_NODATA

4

A grid has no data at the position. Associated with OUT_OF_DOMAIN and requires a grid stage.

NUMERICAL

5

Numerical failure. Associated with NUMERICAL_FAILURE.

OUTSIDE_IMPLEMENTATION_LIMITS

6

Outside an implementation fence or a narrower selected-operation guard. Associated with OUT_OF_DOMAIN. A reference implementation may still return a finite coordinate.

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.