TransLT.exe software can also be used by external call from the command line or by calling it by another program. In such case TransLT makes the conversion of a coordinates file according to a transformation model taken from file or draws graphical entities in Google Earth.
Program settings on units and general options are used for this conversion and can be changed from the main program using button Options.
Using TransLT from the command line
1. Convert a coordinate file
-
where:
- /F - Indicates the option to convert a coordinate file;
- ModelFile - file name with the transformation model, file with mtr or mtrs extension;
- ModelIndex - select the model number. For mtr files the index is always 1 and for files with multiple models mtrs the index is from 1 upwards;
- UseReversed - Select if the transformation model is used reversed or not and it can be "T" or "F" meaning True or False;
- InputFile - the input data coordinate filename;
- OutputFile - the filename in which the calculated coordinates will be saved;
- ShowError - Parameter that shows if there are or not displayed the possible errors and it can be "T" or "F" meaning True or False;
- AppHwnd - handle of the window that will receive messages regarding errors, execution progress in percentages and execution ending message;
- EpochT - decimal year used only for the time-dependent transformations; if the value is missing, the current date is used in calculation.
- EpochT0 - decimal year used only for velocity grid to calculate T - T0; if the value is missing, the current date is used in calculation.
The parameters between brackets [ ] are optional and these brackets do not need to be written in the command line.
The output file must be different from the input file; the program does not save the data for the input file because this input data will be lost.
2. Convert a coordinate file with entities and draw directly into Google Earth or save the file in csv, xml, kml or kmz format
-
where:
- /D - indicates the option of converting a file and drawing entities in Google Earth or saving to csv, xml, kml or kmz format;
- ModelFile - file name with the transformation model, file with mtr or mtrs extension;
- ModelIndex - select the model number. For mtr files the index is always 1 and for files with multiple models mtrs the index is from 1 upwards;
- InputFile - the input data filename, file with entities defined in N, E coordinates, only in that order;
- EditEnts - select if the resulted file with entities is edited or not, the parameter can be "T" or "F" meaning True or False. In the case of "T" the TransLT window for drawing in Google Earth is open;
- OutputFile - the filename in which the calculated coordinates will be saved; it can be csv or xml (for TransLT), kml or kmz (for Google Earth);
- DelInpFile - select if the input file is deleted or not, the parameter can be "T" or "F" meaning True or False;
- EpochT - decimal year used only for the time-dependent transformations; if the value is missing, the current date is used in calculation.
- EpochT0 - decimal year used only for velocity grid to calculate T - T0; if the value is missing, the current date is used in calculation.
The parameters between brackets [ ] are optional and these brackets do not need to be written in command line.
If the output filename parameter OutputFile is an empty string and EditEnts is False or if both are omitted, the entities from the file are drawn directly in Google Earth.
3. Open the TransLT window to convert coordinates from file and then open the TransLT window to draw entities in Google Earth
-
where:
- /CG - indicates the option of converting a file and then drawing in Google Earth using TransLT windows;
- InputFile - the input data filename, file with entities defined in N, E coordinates, only in that order.
4. Common options of using TransLT in Windows
-
where:
- /M - opens the model or models file to add to the models list of main program;
- ModelFile - transformation model filename, file with mtr or mtrs extension.
-
where:
- /P - indicates the option of opening the TransLT window to draw a polygon in Google Earth.
-
where:
- /G - indicates the option of opening the TransLT window to draw entities in Google Earth;
- InputFile - the input data filename, file with entities defined in geographical coordinates in csv or xml format.
-
where:
- /C - indicates the option of opening the TransLT window to convert files with coordinates.
Opens the TransLT coordinate conversion window and add file.
-
where:
- InputFile - the input data coordinate filename.
Displays the help in command line, the display is made in English only.
Examples of use
Example of using from the command line or in a batch .bat file:
Example of calling from another program (pascal syntax in Delphi):
where Self.Handle variable represents the handle of the window that launched TransLT.
Example of calling from another program (c++ syntax in VS 2010):
where this->Handle variable represents the handle of the window that launched TransLT.
-
In this case the window that launched TransLT will receive messages referring
to:
- execution progress in percentages from 0 to 100;
- error messages;
- execution ending message.
Description of messages transmitted by TransLT
Messages are sent using SendMessage function with WM_COPYDATA message identifier:
where the variable cds is of the type TCopyDataStruct in pascal or COPYDATASTRUCT in c++.
-
The variable values transmitted by cds may be, depending on message, the
following:
- Implementation progress messages:
- cds.cbData = number of characters contained in cds.lpData ;
- cds.lpData = 'PROG_BAR_POS' identification text;
- cds.dwData = percent with values between 0 and 100.
- Error messages:
- cds.cbData = number of characters contained in cds.lpData ;
- cds.lpData = text with the error message according to the language set in TransLT;
- cds.dwData = the number of the error greater than 0.
- Final message termination of execution:
- cds.cbData = number of characters contained in cds.lpData ;
- cds.lpData = 'CONV_DONE' identification text;
- cds.dwData = 0.
The procedure performed when messages are received (pascal syntax in Delphi):
The function performed when messages are received (c++ syntax in VS 2010):
To implement in your applications you can download test applications built in Delphi and Visual C++.