geodetic-engine

Coordinate transformations you can defend.

geodetic-engine is a Python library built on PROJ and pyproj. PROJ does the arithmetic. This package decides whether PROJ’s answer can be trusted, refuses it when it cannot, and records exactly how every coordinate was produced.

from geodetic_engine.geodesy import transform

result = transform("EPSG:4230", "EPSG:4326", (2.5, 63.5), operation="EPSG:1612")
result.coordinates      # ((2.49818..., 63.49961...),)  lon, lat in degrees
result.operation.name   # 'ED50 to WGS 84 (23)'
result.pipeline         # the exact PROJ pipeline that ran

A wrong coordinate that looks right is worse than an error, because nobody checks it again. So a datum change must name its operation, a ballpark approximation is refused, a missing grid is an error, and a time-dependent operation needs a coordinate epoch.

What the package does

  • Transforms coordinates with a stated operation. Between geographic, projected, vertical, compound and engineering CRSs, from EPSG or from your own definitions. A datum change names its transformation, and the one named is the one applied.

  • Refuses results it cannot vouch for. Ballpark approximations, a missing grid, a time-dependent operation without a coordinate epoch: each raises an error that says what was wrong, instead of returning a plausible number.

  • Lists what the PROJ database holds. CRSs, transformations, datums, ellipsoids, units, methods, coordinate systems and grid files, filtered by area, datum, accuracy, deprecation and more, as tables or PROJJSON.

  • Records provenance. Every result carries the applied operation, its accuracy, the grids used, the coordinate epoch, the exact PROJ pipeline, and fingerprints of the proj.db that answered, so a result can be reproduced and audited later.

  • Reads and writes OSDU persistableReferences, and transforms with exactly the CRS or operation a payload states.

  • Evaluates projection factors. Grid convergence and point scale factor at any point of a projected CRS, with the sign convention stated.

  • Positions wellbores. A directional survey, by minimum curvature, georeferenced in a CRS on its own datum, with dogleg severity and a 3D view.

  • Builds custom PROJ databases. Adds an organisation’s CRSs and transformations, from a Georepository register or an OSDU catalogue, to a validated copy of PROJ’s proj.db.

  • Works around known PROJ and EPSG problems, such as engineering CRS axis order, and documents each workaround with the condition for removing it.

Modules

Module

Purpose

geodetic_engine.geodesy

Transformations, CRS inspection, operation lookup, results and provenance, projection factors

geodetic_engine.catalog

Discover CRSs, operations, datums, ellipsoids, units, methods, coordinate systems and grids in the PROJ database

geodetic_engine.welltrajectory

Well trajectories from directional surveys: minimum curvature, georeferencing in a CRS, 3D plots

geodetic_engine.bingrid

Seismic bin grids: P6 conversion, four-corner squaring and QC, outlines

geodetic_engine.persistablereference

Parse and emit OSDU persistableReference payloads

geodetic_engine.georepository

Authenticated client for a Georepository API

geodetic_engine.projdb

Build a proj.db from a Georepository register (geodetic-projdb)

geodetic_engine.osdudb

Build a proj.db from an OSDU catalogue (geodetic-osdudb)

For coordinate transformations, PROJ does all the numerical work, and the package is a layer over pyproj that decides which operation runs, checks the result, and records how it was produced. It is a library, not a service: transformations run locally and never contact the Georepository. See Architecture.

When to use it

Use it when you must be able to say which operation produced a coordinate, with what accuracy, and from which database. Use plain pyproj when PROJ may pick the operation for you and an unstated accuracy is acceptable, for example when drawing a map. Design guarantees lists what this package does differently from pyproj.

Requirements

  • Python 3.13 or later.

  • PROJ 9.9.0 and pyproj 3.8.0, built against each other. The EPSG dataset in proj.db is part of every answer, so the versions are pinned. The devcontainer installs both; see Installation.

  • Licensed under Apache 2.0.

Start here

Getting started

Install the pinned PROJ and pyproj, transform your first point, and learn the ideas the rest of the documentation assumes you know.

Getting started
User guide

Task-oriented guides for every module: transformations, projection factors, well trajectories, seismic bin grids, the Georepository client, and custom proj.db builds.

User guide
Examples

Worked notebooks that run during every documentation build, so every number shown is real output.

Examples
API reference

Every public class and function, generated from the docstrings.

API reference
Command-line tools

geodetic-projdb and geodetic-osdudb: every option, with the example configuration files.

Command-line tools
Known issues and workarounds

What this package works around in PROJ and the EPSG dataset, why, and when each workaround can be removed.

Known issues and workarounds

Where to find what

I want to…

Go to

Transform coordinates between two CRSs

Conversions and transformations

Find out which operations exist between two CRSs

Choosing an operation

Find a CRS for an area and datum, or list what the database holds

Finding CRSs, Catalog

List the transformations an authority publishes, deprecated ones included

Finding operations

See which grid files are installed, and which operations need them

Grid files

Understand why my transformation was refused

Errors and refusals

Turn an azimuth between true and grid north, or scale a distance onto the grid

Projection factors

Transform or round a geometry in WKT, WKB, EWKB, GeoJSON or Esri JSON

Geometries

Convert a GeoJSON, JSON-FG or OSDU AnyCrs GeoJSON document

GeoJSON documents

Position a well from its directional survey

Building the input

Square up a seismic bin grid, or convert it to another CRS

Seismic bin grids

Read or write an OSDU persistableReference

Reading, transforming and writing payloads

Understand what a persistableReference is, or look up the one a catalogue publishes

Persistable references (OSDU), Persistable references from a catalogue

Add my organisation’s CRSs and transformations to PROJ

Custom PROJ database

Use my organisation’s CRSs without Georepository credentials

Sharing a built database

Know what the package does differently from plain pyproj

Design guarantees

Look up a term such as bound CRS or ballpark

Glossary