noaa-ocs-hydrography / vyperdatum

Use VDatum grids in PROJ to transform points and GDAL supported raster files
Creative Commons Zero v1.0 Universal
12 stars 4 forks source link

Vyperdatum

Python module that drives PROJ to use VDatum grids in a simple and clear way. Requires that VDatum be installed already (you can find VDatum here. Developed in Python3.

VDatum is "a free software tool being developed jointly by NOAA's National Geodetic Survey (NGS), Office of Coast Survey (OCS), and Center for Operational Oceanographic Products and Services (CO-OPS)...to vertically transform geospatial data among a variety of tidal, orthometric and ellipsoidal vertical datums".

Vyperdatum allows for VDatum to be used in production bathymetric processing software in a clean and precise way. In addition, Vyperdatum builds a custom Compound and Vertical CRS object that well documents the resulting transformation, so that the inverse transformation can be accurately applied later to get back to the pivot datum (NAD83(2011)/EPSG:6319.

Installation

Vyperdatum is not on PyPi, but can be installed using pip.

(For Windows Users) Download and install Visual Studio Build Tools 2019 (If you have not already): MSVC Build Tools

Download and install conda (If you have not already): conda installation

Download and install git (If you have not already): git installation

Some dependencies need to be installed from the conda-forge channel. I have an example below of how to build this environment using conda.

Perform these in order:

conda create -n vyper python=3.8.8

conda activate vyper

conda install -c conda-forge gdal=3.2.1

pip install git+https://github.com/noaa-ocs-hydrography/vyperdatum.git#egg=vyperdatum

Quickstart

Vyperdatum offers to main classes:

For either of these objects, the first run needs to set the path to the VDatum installation in order for Vyperdatum to initialize properly:

from vyperdatum.points import VyperPoints
vp = VyperPoints(vdatum_directory='path/to/vdatum')

From there it is simple to start performing transformations. Use the following examples to get started:

-- we assume vdatum_directory has already been set in these examples --