Skip to main content

A standalone utility for vertical elevation datum transformations.

Project description

🌍 Transformez ↕

Vertical datum transformations, simplified.

⚠️ BETA STATUS: This project is in active development (v0.1.1).

Transformez is a standalone Python library and CLI for converting geospatial data between vertical datums (e.g., MLLW to NAVD88).

Why Transformez?

Vertical datum transformation is often the hardest part of coastal DEM generation. Existing tools are either massive, complex desktop software or buried deep within heavy GIS libraries that are difficult to automate in a headless Linux environment.

Transformez solves this by being:

  • Lightweight: A pure Python package that does one thing well. It doesn't require a GUI or a 5GB installer.
  • Grid-Based: It uses the official VDatum GTIF/GTX grids directly, ensuring your transformations match authoritative standards.
  • Developer Friendly: It offers a clean Python API for integrating vertical shifts directly into your numpy/rasterio pipelines, plus a CLI for quick batch processing.

It works in two ways:

  1. Standalone CLI: Generate shift grids (TIF) for any region or match an existing DEM.
  2. Fetchez Plugin: Automatically transform data as it is downloaded.

Shift Grid Example (Above: A generated vertical shift grid transforming MLLW to NAVD88)

Features

  • Tidal Transformations: Wraps NOAA's VDatum to transform between tidal surfaces (MLLW, MHHW) and geometric datums.
  • Geoid Grids: Seamlessly applies PROJ-CDN geoids (GEOID18, GEOID12B, EGM2008).
  • Time-Dependent Shifts: Integrates HTDP to handle crustal velocities and epoch transformations.
  • Grid Engine: Automates the fetching, stitching, and mosaicking of partial VDatum grids into a single continuous shift surface.

Installation

  • Requires Fetchez (v0.3.3+) and standard geospatial libs.

  • HTDP / VDatum: See NOAA Geodesy Tools.

# Clone and install
git clone https://github.com/ciresdem/transformez.git
cd transformez
pip install -e .

Usage

  1. Standalone CLI Use transformez to generate shift grids for use in other software (PDAL, GDAL, CARIS) or to transform a specific DEM directly.
  • Mode A: Region & Resolution

Generate a generic shift grid for a specific bounding box.

# Generate a shift grid from MLLW (5866) to NAVD88 (5703)
# -R: West/East/South/North
# -E: Grid resolution (e.g., 3 arc-seconds)
transformez -R -95.5/-94.5/28.5/29.5 -E 3s \
    --vdatum-in "5866" \
    --vdatum-out "5703:g2018" \
    --output mllw_to_navd88.tif
  • Mode B: Match Input DEM

Automatically extract the bounds and resolution from an input DEM and generate a matching transformed output.

# Transform an existing DEM from Ellipsoidal (6319) to Orthometric (5703)
transformez --dem input_dem.tif \
    --vdatum-in "6319" \
    --vdatum-out "5703" \
    --output output_navd88.tif
  1. As a Fetchez Hook Configure fetchez to generate transformation grids automatically for downloaded data regions.
# Download SRTM and prepare a shift grid from EGM96 to WGS84
fetchez srtm_plus -R -120/-119/33/34 --hook transformez:datum_in=5773,datum_out=4979

Python API

Transformez can be used directly in Python scripts to generate shift grids or transform arrays.

1. Generate a Vertical Shift Grid

Use VerticalTransform to calculate the shift array (numpy) between two datums for a specific region.

from transformez.transform import VerticalTransform
from fetchez.spatial import Region
from transformez.grid_engine import GridWriter

# 1. Define the Region (West, East, South, North)
#    and the Grid Dimensions (nx, ny)
region = Region(-95.5, -94.5, 28.5, 29.5)
nx, ny = 1200, 1200 

# 2. Initialize the Transformer
#    - MLLW (5866) -> NAVD88 (5703) via GEOID18
vt = VerticalTransform(
    region=region,
    nx=nx, ny=ny,
    epsg_in="5866",       
    epsg_out="5703:geoid=g2018" 
)

# 3. Generate the Shift Array (numpy)
#    Returns: (shift_grid, uncertainty_grid)
shift_grid, unc = vt._vertical_transform(vt.epsg_in, vt.epsg_out)

# 4. Save to GeoTIFF
GridWriter.write("mllw_to_navd88.tif", shift_grid, region)

2. Transform an Existing DEM

If you have a DEM and a generated shift grid, you can apply the transformation mathematically using GridEngine.

from transformez.grid_engine import GridEngine

# Apply the vertical shift: Output = Input + Shift
# Matches pixels 1:1, handling NoData and bounds automatically.
GridEngine.apply_vertical_shift(
    src_dem="input_ellipsoidal.tif",
    shift_array=shift_grid,  # numpy array from step above
    dst_dem="output_orthometric.tif"
)

3. Parse SRS & Datums

You can use the helper classes to resolve complex datum strings or EPSG codes.

from transformez.definitions import Datums

# Get VDatum CLI string for an EPSG
v_str = Datums.get_vdatum_id(5866) 
# Returns: 'mllw:m:height'

# Get Default Geoid for a Datum
geoid = Datums.get_default_geoid(5703)
# Returns: 'g2018'

Supported Datums

Transformez supports EPSG codes and common vertical datum names.

Ellipsoidal: 6319 (NAD83 2011), 4979 (WGS84)

Orthometric: 5703 (NAVD88), 5702 (NGVD29), 3855 (EGM2008)

Tidal: 5866 (MLLW), 5869 (MHHW), 5714 (MSL)

Geoids: g2018, g2012b, xgeoid20b, egm2008

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2010-2026 Regents of the University of Colorado

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transformez-0.1.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transformez-0.1.1-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file transformez-0.1.1.tar.gz.

File metadata

  • Download URL: transformez-0.1.1.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for transformez-0.1.1.tar.gz
Algorithm Hash digest
SHA256 45d6aa23e011cdaf23b92bfc4b6ad25a00a2410760d1d4bdfc1e17f4c9cf8130
MD5 08071db7aefd742b985dfff60b4ec8d5
BLAKE2b-256 d2d4ecec30ecc03fb8eae8df12be1cda086dca17a44d7aad0606a1bb5cfec5bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for transformez-0.1.1.tar.gz:

Publisher: publish.yaml on ciresdem/transformez

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transformez-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: transformez-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for transformez-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58bb7f0ad9d3eb95e3bf3d88c41bfc3069af8fb040a8e32449ceea49bfe38229
MD5 e956124e65715b157b40fdd768db3e1a
BLAKE2b-256 7e7fc4e6c44c9ecf1f6c8386d0ba0e33264f5b2a851ba810506d379349a5e08f

See more details on using hashes here.

Provenance

The following attestation bundles were made for transformez-0.1.1-py3-none-any.whl:

Publisher: publish.yaml on ciresdem/transformez

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page