Skip to main content

geodetic-engine

PyPI Python Tests Lint and type check Documentation License Ruff Checked with mypy

geodetic-engine is a Python library for transforming coordinates between coordinate reference systems (CRSs) under explicit, verifiable rules. It is built on PROJ and pyproj: PROJ performs the numerical computation, while geodetic-engine determines which coordinate operation is applied, validates the result before returning it, and records the provenance required to reproduce and audit it. A transformation that cannot be carried out exactly as specified is refused with an error rather than approximated.

Documentation: https://equinor.github.io/geodetic-engine/

  • Explicit operations. A datum change must name its transformation, or use a bound CRS that names it. The operation named is the one applied.
  • Refuses untrustworthy results. No ballpark approximations, no silent fallback when a grid is missing, no time-dependent transformation without a coordinate epoch.
  • Provenance on every result. The applied operation, grids, epoch, the exact PROJ pipeline, and fingerprints of the proj.db that answered.
  • Numeric batches and lazy streams. Reuse a Transformation with transform_arrays() for owned NumPy output buffers, or transform_batches() for lazy bounded batches, without constructing Python objects per output point.
  • OSDU persistableReference support. Read and write the JSON/ESRI WKT envelope, and transform with exactly what it states.
  • Geometries. Transform, convert and round geometries in WKT, WKB, hex WKB, PostGIS EWKT/EWKB, GeoJSON and Esri JSON with Transformation.transform_geometry(), with exact half-up rounding.
  • GeoJSON documents. Convert RFC 7946 GeoJSON, OGC JSON-FG and OSDU AnyCrs GeoJSON to another CRS with geodetic_engine.geojson.convert_geojson, keeping structure and properties; a drop-in for the OSDU convertGeoJson.
  • Custom PROJ databases. Add a Georepository register's or an OSDU catalogue's own CRSs and transformations to a copy of PROJ's proj.db.
  • Projection factors. Grid convergence and scale factor of any projected CRS, with geodetic_engine.geodesy.projection_factors.
  • Well trajectories. Minimum-curvature trajectories from directional surveys, placed in a CRS; see the welltrajectory README.
  • Seismic bin grids. Convert between bin grid and map grid with P6 parameters, check and square up a four-corner grid, convert it to another CRS, and match a legacy dataset to a stored grid.

Quickstart

from geodetic_engine.geodesy import transform

# ED50 -> WGS 84 in Norwegian waters, with a named EPSG transformation.
result = transform("EPSG:4230", "EPSG:4326", (2.5, 63.5), operation="EPSG:1612")

result.coordinates        # ((2.49818..., 63.49961...),)   lon, lat: always xy order
result.operation.name     # 'ED50 to WGS 84 (23)'
result.operation.accuracy # 1.0 (metres)
result.pipeline           # the PROJ pipeline that ran, replayable in plain pyproj

Leave out operation= and the call raises AmbiguousOperationError, because several ED50 to WGS 84 transformations exist and they disagree by metres. Use available_operations("EPSG:4230", "EPSG:4326") to choose one.

Installation

The library needs PROJ 9.9.0 and pyproj 3.8.0 built against it, because the EPSG dataset inside proj.db is part of every answer. Install the released package and the matching wheel together:

pip install "pygeodetic-engine" "pyproj==3.8.0+proj9.9.0" \
    --extra-index-url https://equinor.github.io/geodetic-engine/simple/

The explicit wheel requirement also replaces a previously installed PyPI pyproj wheel. If a matching wheel is unavailable, build pyproj from source against the pinned PROJ instead. Importing the package rejects another PROJ version rather than silently using its EPSG dataset. Wheels do not include the full grid package; install the grids needed by your operations separately.

The wheel ships PROJ's database with the official OSDU catalogue already built into it, and PROJ reads it once geodetic_engine is imported. OSDU CRSs, record ids and persistable references resolve with no build step:

import geodetic_engine
from pyproj import CRS

CRS.from_authority("OSDU", "2003001").name
# 'Grenada 1953 * DOS-Grd / British West Indies Grid [2003,1443]'

A database you chose yourself always wins: a pyproj.datadir.set_data_dir() call before the import, or a PROJ_DATA (or PROJ_LIB) directory holding a proj.db. GEODETIC_ENGINE_OSDU_DB=0 turns the shipped database off, and geodetic_engine.osdudb.active_database() reports which database PROJ reads and why. geodetic-osdudb build still builds a newer or custom catalogue. See Installation.

For development, open the repository in VS Code and choose Reopen in Container. By hand:

./.devcontainer/install-proj.sh                          # build the pinned PROJ
PROJ_DIR=/usr/local PROJ_WHEEL=false uv sync --extra dev # pyproj from source
uv run pytest tests/test_environment.py                  # verify

See Installation for details.

Documentation

Getting started Installation, quickstart, core concepts
User guide Transformations, OSDU payloads, the Georepository client, custom proj.db builds, seismic bin grids
Examples Executed notebooks
API reference Every public class and function
Command-line tools geodetic-projdb, geodetic-osdudb
Known issues and workarounds What is worked around in PROJ, EPSG data, and the APIs, and when each can be removed

To build the documentation locally:

uv run --extra docs sphinx-build -W --keep-going -b html docs docs/_build/html

Development

uv run pytest                  # the usual run
scripts/run_all_tests.sh       # including the exhaustive dataset sweep
uv run ruff check geodetic_engine tests && uv run mypy geodetic_engine
uv run lint-imports            # the import layering contracts

See Development. The PROJ, proj-data and pyproj releases are pinned in one file, .devcontainer/pins.env; to move them, follow runbooks/upgrading-proj-and-pyproj.md.

License

See LICENSE.

Metadata

Release files for pygeodetic-engine 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygeodetic-engine 0.3.0
File Size Uploaded Provenance Actions
pygeodetic_engine-0.3.0.tar.gz 7.3 MB With provenance Details for pygeodetic_engine-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygeodetic-engine 0.3.0
File Interpreter ABI Platform Actions
pygeodetic_engine-0.3.0-py3-none-any.whl Python 3 none any Details for pygeodetic_engine-0.3.0-py3-none-any.whl

Total release size: 11.5 MB

Release files / pygeodetic_engine-0.3.0.tar.gz

Download URL pygeodetic_engine-0.3.0.tar.gz
Size 7.3 MB
Tags Source
SHA-256 checksum
How to use checksums
628185c76fee94aecace2314ee85d3a852029e80c2188c6e36c433ecec8baff9
BLAKE2b-256 checksum
How to use checksums
b05731e48598506a2ed0e8bb0b36a1c88532b488d6a4379ef3c64b250af71d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / pygeodetic_engine-0.3.0-py3-none-any.whl

Download URL pygeodetic_engine-0.3.0-py3-none-any.whl
Size 4.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
877928f3ce6c1c6f587df77ca688989ac47fa397735d677a5989baf2c89069a4
BLAKE2b-256 checksum
How to use checksums
33d53410557c65ae407abfa29fed23ea450a48f5475aac43109735059d824c13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for pygeodetic-engine 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pygeodetic_engine-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page