Support for grid-based datum correction files (+nadgrids proj.4 parameter)


Several national mapping agencies publish a grid-based datum file for use when converting between different CRSs.

One example is the OSTN02 file published for Ordnance Survey for use with EPSG:27700 (British National Grid) CRS, which can be downloaded here: https://www.ordnancesurvey.co.uk/business-and-government/help-and-support/navigation-technology/os-net/ostn02-ntv2-format.html

Without this file, conversions are from WGS84 to BNG are only accurate to 5-7m. With the grid shift file, error reduces to centimetres.

This functionality is already implemented in proj.4 C library, and is used by specifying a path to the gridshift file with the +nadgrids parameter, see here for details: https://trac.osgeo.org/proj/wiki/GenParms#nadgrids-GridBasedDatumAdjustments

The work would require a parser for the NTv2 format that grid files are usually delivered in, and the function to apply the grid shift. Details of both can be found in the existing proj4 C source code.