Prototype and description of the function convntvascii2bin()

(Function of the unlock requiring group "NTv2 grid data")


Convert ASCII file with NTv2 grid data to binary.

Prototype of the DLL function in C++ syntax (attend lower case!):
extern "C" __declspec(dllimport) unsigned long __stdcall convntvascii2bin(
     char *pszFileAscii);

Prototype of the DLL function in Visual Objects syntax:
_DLL function convntvascii2bin(;
     pszFileAscii AS PSZ);                    // 4 Byte, char*
as logic pascal:geodll32.convntvascii2bin     // 4 Byte

The function converts an ASCII file with NTv2 grid data to a more efficient
binary file, which can be used for Reference System Transitions using grid
shift data.

You can download the NTv2 files supported by GeoDLL directly from the
KilletSoft Internet site
or use the download links to the original sources there.

After unpacking the ZIP compressed data they are present as ASCII data
files or ready for use as binary files. To be able to use an ASCII file
with GeoDLL functions, first it must be converted to the substantially more
efficient and more compact binary data format. The conversion can take time
up to 10 seconds.

Since the function due to the extensive calculations is time-consuming,
the event handling during the calculation by interrupting the processing loop
can be are allowed bei calling the function seteventloop().

The file name of the ASCII file needed for the Reference System Transition
may contain a drive letter and a directory path. The ASCII file may also
contain a file name extension. The produced binary file has the same name as
the ASCII file, but with the file name extension "gsb". It is produced in the
same directory.
ASCII file  "c:\programm_ntv2daten\BeTA2007.gsa"
Binäry file "c:\programm_ntv2daten\beta2007.gsb"
Attention, in C syntax double backslashes must be used!

The parameters are passed and/or returned as follows:
pszFileAscii  File name of the ASCII file which is to be converted. The
              file name may contain a drive letter, a directory path and a
              file name extension.

returnVal     In case of an error the function returns FALSE, otherwise TRUE.

Deviation from the NTv2 standard inside the NTv2 ASCII file:
1. Anything following a # will be considered a comment and will be ignored.
2. Maximum line length including comments and CRLF is 82 characters.
3. Whitespace is used to delimit tokens in each line, but leading and
   trailing whitespace is ignored.
4. Blank lines are discarded. This is done after removing any comments and
   all leading and trailing whitespace.
5. Grid mesh records contain either two or four floating point values:
   Lat-shift Lon-shift [Lat-accuracy Lon-accuracy]. If the accuracies
   are not specified, they are assumed to be 0.0.
6. GeoDLL supports Polygonal Validity Scopes. thus grid mesh records may
   contain the exopolygonal entries -99/-99 in their shift or accuracy
   values. Detailed information can be found in the help section "Polygonal
   Validity Scopes".

This function is a component of the unlock requiring function group
"NTv2 grid data". It is unlocked for unrestricted use together with the
other functions of the group by passing the unlock parameters, acquired
from the software distribution company, trough the function setunlockcode().
Without unlocking only a few function calls for test purposes (shareware
principle) are possible. It should be noted that in addition the function
group "Coordinate Transformations" must be unlocked.