Prototype and description of the function convntvascii2bin()

(Function of the unlock requiring group "NTv2 Tools")

 

convntvascii2bin()
Convert ASCII file with NTv2 grid data to binary file.

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

Prototype of the DLL function in Visual Objects syntax:
_DLL function convntvascii2bin(;
     pszFileAscii as psz,;                    // 4 Byte, char*
     pszFileBinary 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.

NTv2 ASCII files with syntax errors are rejected by GeoDLL with an error
message.

You can download the NTv2 files supported by GeoDLL directly from the
KilletSoft website http://www.killetsoft.de/p_gdln_e.htm#download or use the
download links to the original sources there. On that Internet site you also
find a detailed description of the NTv2 standard.

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 some
seconds or minutes. With the function convntvascii2bin() you are able to
convert an NTv2 ASCII file to an NTv2 binary file.

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 names of the NTv2 ASCII file and of the generated binary file may
contain a drive letter and a directory path. The ASCII file may contain any
file name extension. The binary file should habve the file name extension
".gsb".
Example:
ASCII file  "c:\program_ntv2data\ascii\BeTA2007.gsa"
Binäry file "c:\program_ntv2data\binary\beta2007_gen.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.

pszFileBinary  File name of the NTV2 binary file which is to be generated.
              The file name may contain a drive letter, a directory path
              and a file name extension. The file name should have the file
              name extension ".gsb".

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".


Unlocking:
This function is a component of the unlock requiring function group "NTv2
tools". 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 no
calls for test purposes (shareware principle) are possible with this function.