vibeproj.crs

CRS resolution — extract projection type and parameters from EPSG codes.

Uses pyproj for CRS metadata extraction, then maps to our internal projection types.

Attributes

Classes

ProjectionParams

Parameters extracted from a CRS needed to configure a projection.

DatumOperationPlan

Datum/reference-frame operation metadata from pyproj/PROJ.

Functions

parse_crs_input(→ pyproj.CRS)

Parse a CRS input to a pyproj CRS object.

resolve_projection_params(→ ProjectionParams)

Extract projection parameters from a CRS.

resolve_transform(→ tuple[ProjectionParams, ...)

Resolve source and target CRS for a coordinate transform.

build_datum_operation_plan(→ DatumOperationPlan)

Inspect the datum/reference-frame operation needed between two CRS.

extract_helmert(src_crs, dst_crs)

Extract Helmert 7-parameter datum shift between two CRS.

Module Contents

type vibeproj.crs.CRSInput = int | str | tuple[str, int] | CRS
class vibeproj.crs.ProjectionParams

Parameters extracted from a CRS needed to configure a projection.

projection_name: str
ellipsoid: vibeproj.ellipsoid.Ellipsoid
lon_0: float = 0.0
lat_0: float = 0.0
lat_1: float = 0.0
lat_2: float = 0.0
k_0: float = 1.0
x_0: float = 0.0
y_0: float = 0.0
x_unit_to_m: float = 1.0
y_unit_to_m: float = 1.0
utm_zone: int = 0
south: bool = False
north_first: bool = False
extra: dict[str, Any]
class vibeproj.crs.DatumOperationPlan

Datum/reference-frame operation metadata from pyproj/PROJ.

This is intentionally an internal planning layer, not a public TransformerPlan API. It records whether a datum operation is needed and how well vibeProj can represent the operation with its current kernels.

cross_datum: bool
source_datum: str | None = None
target_datum: str | None = None
operation: str | None = None
expected_accuracy_m: float | None = None
area_of_use: str | None = None
best_available: bool | None = None
missing_grids: tuple[str, Ellipsis] = ()
best_has_helmert: bool = False
has_available_helmert: bool = False
best_is_noop: bool = False
best_is_ballpark: bool = False
warning_level: Literal['ok', 'degraded', 'unsupported'] = 'ok'
property uses_authoritative_noop: bool

True when PROJ’s best available operation is an explicit no-op.

vibeproj.crs.parse_crs_input(crs_input: CRSInput) pyproj.CRS

Parse a CRS input to a pyproj CRS object.

Accepts: - An EPSG integer code: 4326 - An authority string: “EPSG:4326” or “epsg:4326” - A tuple: (“EPSG”, 4326) - A pyproj CRS object

vibeproj.crs.resolve_projection_params(crs: pyproj.CRS) ProjectionParams

Extract projection parameters from a CRS.

Returns a ProjectionParams object describing the projection type and its parameters. For geographic CRS (lat/lon), returns projection_name=”longlat”.

vibeproj.crs.resolve_transform(crs_from: CRSInput, crs_to: CRSInput) tuple[ProjectionParams, ProjectionParams, pyproj.CRS, pyproj.CRS]

Resolve source and target CRS for a coordinate transform.

Returns (src_params, dst_params, src_crs, dst_crs).

vibeproj.crs.build_datum_operation_plan(src_crs: pyproj.CRS, dst_crs: pyproj.CRS) DatumOperationPlan

Inspect the datum/reference-frame operation needed between two CRS.

pyproj/PROJ is the source of truth for datum operation metadata. This function only plans and classifies operations; it does not execute them.

vibeproj.crs.extract_helmert(src_crs: pyproj.CRS, dst_crs: pyproj.CRS)

Extract Helmert 7-parameter datum shift between two CRS.

Uses pyproj to determine the best available transformation pipeline, then extracts the Helmert operation parameters from the PROJ pipeline string.

Returns

HelmertParams or None

None if same datum, no Helmert available, or identity transform.