Prototype and description of the function convelev03ascii2bin() (Function of the unlock requiring group "Elevation calculations") |
convelev03ascii2bin() Convert ASCII file of the 3 sec. elevation model CGIAR to binary. Prototype of the DLL function in C++ syntax (attend lower case!): extern "C" __declspec(dllimport) unsigned long __stdcall convelev03ascii2bin( const char *pszFileAscii); Prototype of the DLL function in Visual Objects syntax: _DLL function convelev03ascii2bin(; pszFileAscii as psz); // 4 Byte, char* as logic pascal:geodll32.convelev03ascii2bin // 4 Byte The function converts an ASCII file of the 3 sec. elevation model (90 m raster) CGIAR to a more efficient binary file, which can be used for elevation calculations. You can download the data of the 3 seconds elevation model from the Internet site of the "CGIAR Consortium for Spatial information". The current Internet address is "http://srtm.csi.cgiar.org/". Click in the navigation column on the link "SRTM Data Search and Download". Activate the radio buttons "Multiple Selection" and "ArcInfo ASCII". Click inside the world raster map on the segments, from which you need elevation data. Confirm your selection with the Button "Search". In a new window the segments you selected are arranged for the download. Click on one of the links "Data Download (FTP)" or to "Data Download (HTTP)" for each data segment you need to copy the data to your computer. After unpacking the ZIP compressed data they are present as ASCII data files. To be able to use the data with GeoDLL functions, first they must be converted to the substantially more efficient and more compact binary data format. The conversion is done either automatically with first access by the function getelevation03() or independently with the function convelev03ascii2bin(). The conversion can take a long time from some seconds up to minutees. 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 conversion may contain a drive letter and a directory path. The ASCII file must have the file name extension ".ASC". The produced binary file has the same name as the ASCII file, but without the file name extension. It is produced in the same directory. Example: ASCII file "c:\program_elevation\03_sec\SRTM_38_02.ASC" Binary file "c:\program_elevation\03_sec\SRTM_38_02" Attention, in C syntax double backslashes must be used! ASCCI files of the CGIAR versions 2 through 4 are supported. This fle formats are possible: Example of a file name in CGIAR V2 syntax: Z_38_2.ASC. Example of a file name in CGIAR V3/V4 syntax: SRTM_38_02.ASC. The file names are not upper or lower case sensitive. 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 and the directory path. The file name extension must read ".ASC". returnVal In case of an error the function returns FALSE, otherwise TRUE. Unlocking: This function is a component of the unlock requiring function group "Elevation calculations". 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 with this function no calls for test purposes (shareware principle) are possible. |