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 quadrangular grids with shift values.
Instead of a rectangular area only an embedded polygonal area should and must be covered, for example, a state territory within the country borders.
This article describes how Polygonal Validity Scopes can be realized in NTv2 files using a new developed software.
The program NTv2Poly developed by KilletSoft realizes Polygonal Validity Scopes in NTv2 files. Using so prepared NTv2 files, coordinates outside the validity scope can be excluded from calculations or they can be acknowledged by a warning. This works with coordinate transformations using the geospatial software TRANSDATpro and GeoDLL by KilletSoft and with GIS programs which support Polygonal Validity Scopes.
Inclusion of polygonal outlines from a shape file
The Polygonal Validity Scope is realized with a shape file, which contains the outlines of the scope as polygons. The file format Shape is developed by ESRI as a format for geographical objects. For example, in the shape file the border outlines of a country may be stored, which represent the polygonal scope for the NTv2 file used in that country. The polygons contained therein must be available as geographic coordinates in decimal notation. The reference system of the outline coordinates must correspond as closely as possible to the source reference system of the NTv2 file. A shape file in a different coordinate reference system can be converted into the required system using the geospatial software TRANSDATpro by KilletSoft. Using the program NTv2Poly the polygons of the shape file and the quadrangular surface of the NTv2 file are superimposed one on the other and processed in an ingenious manner.
The dBase and index files normally associated with a shape file are not needed. The object file with the polygons, which has the file type ".shp" in the file name, is sufficient. The content of the shape file can consist of a single polygon or multiple polygons. These may occur with or without sub-polygons in the shape file. This is the case if, for example, a national border with the islands belonging to the country is to be displayed. Another case would be the polygons of subordinate administrative units, such as states or districts that make up a country. Decisive are only the outer borders of the entire object. The shape file can contain the outline of the required area in the following polygon compilations:
Please click on the images shown in the following text, so that they will be enlarged for a closer look.
Fig. 1a shows the country outline of the Federal Republic of Germany.
In Fig. 1b are the outlines of the sixteen Federal States, which together represent the country outline of Germany.
Although the contents of the two shape files shown here are different, they will produce the same result when used in the NTv2Poly program.
Outline files in shape format can be downloaded in different quality from some websites. If you want to be sure about the quality, the resolution and the used reference system, you should ask for a suitable outline file at the responsible authorities.
Fig. 2 shows the surface of the program NTv2Poly as screenshot. At the top left, the NTv2 file to be processed is read in, which does not contain Polygonal Validity Scopes yet. The adjacent text box displays all information about this NTv2 file and its grids. To the right of this, the shape file intended for realizing the Polygonal Validity Scopes is read in. The adjacent text box lists information about the shape file and all therein contained polygons. At the bottom left, a new NTv2 file is generated. After starting the processing, the NTv2 grids of the source file are transferred and provided with polygonal scopes. Above the start button between two types of processing can be selected, which are described in more detail below:
Utilization of exopolygonal entries in NTv2 files
The term "exopolygonal entry" used in the course of the text stands for the entry of a characteristic value in a grid mesh of an NTv2 file to exclude this grid mesh from the scope of the NTv2 file. It follows that all grid meshes with exopolygonal entries are invalid. The program NTv2Poly marks all grid meshes that lies outside the polygons of the used shape file as invalid by introducing exopolygonal entries in the NTv2 file.
The NTv2 file contains for all grid meshes two longitude and latitude shift values and two values for the accuracy of the grid meshes. By using exopolygonal entries in the shift values or in the accuracy values of the NTv2 file, there are two methods for realizing Polygonal Validity Scopes, which both are supported by the program. The two methods differ considerably in their effects.
Exopolygonal entries replace the accuracy values of the grid meshes
When using exopolygonal entries in the accuracy values, a single grid mesh is addressed at the grid coordinate. Exactly this grid mesh is defined by the grid point and addressed regarding the interpolation of a coordinate that lies within. This grid mesh is excluded from the polygonal validity scope of the NTv2 grid
Exopolygonal entries replace the shift values of the grid meshes
When using exopolygonal entries in the shift values, a total of four grid meshes adjacent to the grid coordinate are addressed. To calculate any coordinate within a grid mesh by means of the bilinear interpolation, the four adjacent grid points of a coordinate are used. Each of them may contain exopolygonal entries. So, all in all four grid meshes are addressed and each has one grid spacing in northern and southern direction and one grid spacing in western and eastern direction from the grid point. These are the four grid meshes that are arranged around the grid point. Exactly these four grid meshes are excluded from the polygonal validity scope of the NTv2 grid.
Hierarchical grid structure
An NTv2 file is composed of one or several parent and child coordinate grids in hierarchical structure. With compacted grid meshes optional child coordinate grids improve subareas of the parent coordinate grids lying below. In a hierarchical way child grids can appear as parent grids to further child grids lying above (see Fig. 5). Most grid files, e.g. the German Beta2007, only contain one single parent coordinate grid.
To implement polygonal validity scopes, a GIS software can query exopolygonal entries in the four shift and accuracy values of the grid meshes.
During the calculation of reference system transitions, the coordinates that are to be transformed are examined for their association with such grid meshes.
It is crucial whether the grid mesh is part of a parent coordinate grid or of a therein contained child coordinate grid.
In case it lies in a child grid, the attempt is to continue the calculation in the parent grid lying below.
When grid meshes fitting to a coordinate are marked by exopolygonal entries in all hierarchically stacked child and parent grids, then the coordinate is outside of the polygonal validity scope.
It is excluded from the calculation of the reference system transition and the executing software can generate an indication.
In the example shown in Fig. 5, three coordinate grids are arranged one upon the other. Only when a coordinate falls through all exopolygonal grid meshes it lies outside of the polygonal validity and is excluded from the reference system transition.
The source code developed in the programming language C for the evaluation of NTv2 files with Polygonal Validity Scopes in Hierarchical grid structure can be purchased as a license by manufacturers of GIS and geodetic software for use in own software from at the engineering society KilletSoft GbR.
Graphical representation of an NTv2 file before and after processing
The following two figures are evaluations from the program NTv2Poly. For each of the 862 thousand grid meshes contained in the grids of the NTv2 files, a test-wise coordinate transformation has been performed. Valid results are shown in different light blue shades depending on the grid. The quadrangular grids of the NTv2 files are shown as red frames.
Fig. 6 shows the structure of an NTv2 file from whole Canada as developed and published by the Canadian authorities.
Of course, this NTv2 file does not use Polygonal Validity Scopes.
It contains 114 NTv2 grids.
There are four basic grids arranged side by side with many small local grids on top of them.
The small local grids map the large cities and densely populated regions with smaller grid meshes in higher accuracy.
The quadrangular ground grids capture very large areas, which lie outside the territory of Canada.
Fig. 7 shows the same NTv2 file, but this time with Polygonal Validity Scopes.
In this representation, the national boundaries, or better the boundaries of the Canadian provinces, that are taken from the shape file are displayed in dark blue.
All test-wise calculated coordinate transformations in the grid meshes outside the country boundaries were identified as invalid and not entered in the graphic.
The number of effective grid meshes shown here is reduced to 644 thousand.
It can be clearly seen that the scope of the quadrangular grids is limited by the national borders of Canada.
Thus, in grid meshes outside the country boundaries performed coordinate transformations can be excluded from calculations with an indication of their invalidity.
Fig. 8 shows an NTv2 file of the Federal Republic of Germany.
This file has only one grid.
Using the shape file described above, which contains the outlines of the sixteen Federal States of Germany, the NTv2 file has been equiped with Polygonal Validity Scopes.
In this figure, the separate meshes can be seen well, because the mesh size in relation to the shown area is relatively large.
When creating the NTv2 file with the program NTv2Poly, the exopolygonal entries have replaced the accuracy values of the grid meshes.
It is very good to recognize that all grid meshes within the state boundary remain valid.
In addition, all grid meshes of the border area are valid, which have a point of contact with the state boundary.
Testing NTv2Poly without obligation
Detailed information about the program NTv2Poly can be found on the website https://www.killetsoft.de/p_ntpa_e.htm. There you can also download a free trial version. With the test program you have the possibility to generate new NTv2 files with Polygonal Validity Scopes using some supplied NTv2 files and shape files.