Skip to main content

Geosoftware with Tools for analyzing and processing of NTv2 files

By [email protected] - 10th July 2018 - 22:02

The paper describes how to use tools for analyzing and processing of NTv2 files in ASCII and binary formats with the geospatial software NTv2Tools by KilletSoft.

Kempen, July 10, 2018 Dipl.-Ing. Fred Killet - Killet Software Ing.-GbR - Escheln 28a - 47906 Kempen, Germany

The NTv2 (National Transformation Version 2) file standard was developed by the "Department of Natural Resources of Canada" in the middle nineties. Using NTv2 grid files it is possible to transform geodata from one coordinate reference system to another with very high accuracy. An NTv2 file contains one or more quasirectangular grids with shift values which are defined in the NTv2 headers. NTv2 files are available in ASCII and binary formatted variants. The ASCII variant is generated during the development phase of the NTv2 file, whereby all header and grid entries can be read and edited with a word processing program as plain text. For productive use in geodetic software and in GIS, the much faster binary variant with the same content is used.

The program NTv2Tools provides digital tools for developing and processing NTv2 files in binary and ASCII formats. It analyzes NTv2 files and outputs detailed information on the screen, in graphics files and in text files. The program allows conversions between the binary and ASCII formatted variants of the NTv2 files. Furthermore, areas can be extracted from NTv2 files and swapped out to new NTv2 files. This resolves the known issues with oversized NTv2 files.

Using the program the following processings are possible:

  • Analyzing NTv2 files
  • Displaying NTv2 grids and subgrids graphically
  • Displaying normal and polygonal NTv2 activity scopes
  • Converting NTv2 ASCII files to NTv2 Binary files
  • Converting NTv2 Binary files to NTv2 ASCII files
  • Extracting areas from NTv2 files

NTv2 files that have been previously equipped with Polygonal Validity Scopes to map a polygonal boundary instead of a quasi-rectangular area in the NTv2 grids are supported by the NTv2Tools program. The Polygonal Validity Scopes realized in the NTv2 files are taken into account for all types of processing and is displayed in all graphical views. Polygonal Validity Scopes can be realized with the program NTv2Poly or with the Geodetic Development Kit GeoDLL by KilletSoft in any NTv2 files.

Analyzing NTv2 files
This tool can analyze NTv2 binary and NTv2 ASCII files. After starting the analysis, the header information of the selected NTv2 file and the information about all grids of the NTv2 file are displayed in a text field. If there were found are any errors in the NTv2 file, they are listed in the text box.

In the header the information about the reference systems are listed, between which can be transformed using this of NTv2 file. Here the semi-axes of the earth ellipsoids matching the reference systems are listed. Also the number of subgrids included in the NTv2 file is listed in the header. Further information contained in the header is necessary for the transformation process.

Each subgrid in turn has its own header. Therein the boundaries of the subgrids and their mesh sizes, as well as the memberships to parent grids and the numbers of available grid meshes are listed. The information of all subgrids with their creation and modification dates is listed in the text
field in order of their position in the NTv2 file.

Displaying NTv2 grids and subgrids graphically This tool displays the outlines of all grids contained in the selected NTv2 grid file as dark red rectangles with hatching in different bright red colors. At the bottom of the window the geographical coordinates at the mouse pointer and the number of grids contained in the NTv2 file are shown.

An NTv2 file contains one or more grids that can be nested next to or above each other. In order to achieve higher accuracies for certain areas, for example in metropolitan areas, NTv2 subgrids with smaller and therefore more precise grid meshes can be arranged on underlying parent grids.

On four basic grids arranged side by side with large mesh sizes many small subgrids with small mesh sizes are placed. These provide very accurate transformation values for Canadian cities and metropolitan areas.

Displaying normal and polygonal NTv2 activity scopes The activity scopes of all grids contained in the NTv2 grid file are displayed here in different shades of blue. If the NTv2 file contains Polygonal Validity Scopes, only the grid meshes of the available polygonal areas are displayed, otherwise all grid meshes of the quasi-rectangular grid areas are displayed. Up to a certain threshold the outlines of the grid meshes are highlighted in dark blue color. At the bottom of the window the geographical coordinates at the mouse pointer, the number of grids contained in the NTv2 file and the number of grid meshes are shown. The grid outlines of all grids and subgrids contained in the NTv2 grid file are displayed as red rectangular borders.

Depending on the selected NTv2 file, the building of the graphic may take some time, because a test calculation is performed for each grid mesh. This makes possible to detect defective grid meshes.

Here also four basic grids arranged side by side with many small subgrids on top are depicted. The number of effective grid meshes here is reduced to 644 thousand. It can be seen that the activity scope is limited by the borders of Canada. Thus, grid meshes outside the country boundaries can be excluded from calculations in coordinate transformations with a hint about their invalidity.

Converting NTv2 ASCII files to NTv2 Binary files For the ASCII version of NTv2 files the extension ".gsa" is used, what means "Grid Shift ASCII". The productive usable binary NTv2 files have the extension ".gsb" which stands for "Grid Shift Binary". The ASCII version is used during the development phase of an NTv2 file because all components then can be assembled with a word processor.

This tool converts NTv2 ASCII files (.gsa) to NTv2 binary files (.gsb). After the selection of the NTv2 ASCII file and the definition of a file name for the new NTv2 binary file, the conversion can be started. In the text field the headers of the NTv2 ASCII file and the new NTv2 binary file are displayed.

Converting NTv2 Binary files to NTv2 ASCII files Sometimes it makes sense to convert a binary file back to an NTv2 ASCII file. This has the advantage that the file then can be read and edited in plain text using a word processing program.

This tool converts NTv2 binary files (.gsb) to NTv2 ASCII files (.gsa). After the selection of the NTv2 binary file and the definition of a file name for the new NTv2 ASCII file, the conversion can be started. In the text field the headers of the NTv2 binary file and the new NTv2 ASCII file are displayed.

Extracting areas from NTv2 files This tool can be used to extract an area defined by coordinates from a large NTv2 file and place it in a new NTv2 file of smaller size considering all the included NTv2 grids. The coordinate window for the clipping is determined by entering geographical coordinates in the bounding boxes "West", "North", "East" and "South". After selecting the source file in binary format and specifying a filename for the new NTv2 binary file in which the clipping will be saved, the extraction can be started. The following information is displayed in the text field:

  • Proposed boundaries for the area to be extracted
  • NTv2 header of the NTv2 source file
  • Boundaries of the area in the source file
  • NTv2 header of the new NTv2 file
  • Calculated boundaries of the area in the new NTv2 file

The clipping contains only 15 grids with 411 thousand of originally 644 thousand grid meshes. It can be seen that the Polygonal Validity Scopes are also applied to the smaller subgrids.

Recently NTv2 files with very high accuracy in the centimeter range have been developed, which are suitable for the transformation of geodata of real estate cadastre. The high point density required for this leads to a large number of grid meshes in the NTv2 files. As a result, the file sizes of some NTv2 grid files are enormous. NTv2 files larger than 3 gigabytes are known.

The use of such large NTv2 files is a new trend that developers of geodetic software and GIS could not anticipate. Thus it is not surprising that the NTv2 file BY-KanU.gsb by the German Federal State Bavaria with a lot of software products can not be used. Here, the file size exceeds the by "long integer" addressable file range of about 2,2 gigabytes. Often the grids of the NTv2 file are held in memory due to the calculation speed. However, this is usually not possible with such large grids. These problems can be eliminated only with a great development effort and require a certain changeover time.

This tool allows copying a required area from a large NTv2 file by defined corner coordinates. The separated area is placed in a new NTv2 file that is much smaller than the original. Thereby all subgrids whose area intersects the given area are taken into account. The newly generated NTv2 file now can be used as usual in all geodetic programs and GIS.

If, for example, only the Munich area is needed for coordinate transformation using NTv2, with the tool it can be cut out from the Bavarian NTv2 file BY-KanU.gsb by defining the corner coordinates of the area of Munich. In a test, conducted by KilletSoft, the resulting NTv2 file only had the 120th part of the original file size.

Read More: Satellite Positioning, Navigation & Timing (PNT) Cartography GIS Interoperability & Open Standards Education & Research

Subscribe to our newsletter

Stay updated on the latest technology, innovation product arrivals and exciting offers to your inbox.

Newsletter