REM 723.bat, "Seven to three" parameters Goto EndOfDocument This is a sample run, which calculates parameters for a three parameter similarity transformation based on known parameters for a corresponding seven parameter similarity transformation and the geographical area, where the calculated parameters for the three parameter similarity transformation will be used. Input: - Parameters of a seven parameter similarity transformation. That is done by defining a datum with those parameters and using this datum in this run. - Set of points representing the area, where the parameters will be used, that is, where the best accuracy is desired. In this example the poins are saved if file c:\gps\723incrd.txt in format which is represented below. This example "defines" Finland, which lies appr. between latitudes 60 and 70 degrees and longitudes 20 and 30 degrees. Example of c:\gps\723incrd.txt: 70, 30, 0 70, 20, 0 60, 30, 0 60, 20, 0 The coordinates in this example are the "corners" of the selected area. However, you can choose any "pattern" of coordinates, even only one point, if it represents your needs. Smaller area gives better accuracy, but remember not to use the parameters far outside the selected area. Output: - Parameters for a three parameter similarity transformation Method: Calculate converted coordinates for a given set of points using a known seven parameter similarity transformation. Calculate 3D-cartesian coordinates (X,Y,Z) for both original and converted coordinates. Calculate average differences between the cartesian coordinates = average (converted X,Y,Z) - (original X,Y,Z). The result, parameters for the three parameter similarity trans- formation, are the opposite numbers to calculated averages. Running this batch: Prepare c:\gps\723incrd.txt and edit this run to agree with your needs and your computer environment. Check, that the seven parameter transformation is defined in datum-file datum.val and use it in this run instead of KKJ, which is used as an example. The result is show automatically and is saved in the file c:\gps\723out.txt Implementation, phase 1: Create a file (c:\gps\723temp.txt), where first three columns contain the original points from 723inctd.txt and columns 4-6 contain coordinates converted using the seven parameter similarity transformation. Implementation, phase 2, Compare original and converted values: Calculate average differences in cartesian 3D-coordinates X, Y and Z, which in Geoconv are named CX, CY and CZ. The corresponding average differences are in GeoConv named AVEIN2DCX, AVEIN2DCY and AVEIN2DCZ. The result, parameters for the three parameter similarity trans- formation, are the opposite numbers to calculated average diffe- rences in 3D cartesian coordinates: DX = -1 * AVEIN2DCX DY = -1 * AVEIN2DCY DZ = -1 * AVEIN2DCZ If the footer line of the output-file 723out.txt is e.g. like below, the rounded parameters would be -75, -230 and -91. 723temp, 222.477, 209.841,75.268640,230.457313,90.852428 Columns: - 1: output-datum - 2-4: maximum distance and avegare distance - 5-7: average differences in 3d-cartesian coordinates Accuracy: The actual accuracy of the calculated three parameters depends on how good is the seven parameter transformation, how the area is selected and how big distortion there is in the scale and orientation of the actual coordinate reference frame. However, this method gives the best accuracy that can be derived from the input-information. The actual accuracy could be tested only against measured coordinate values. :EndOfDocument REM PHASE 1: CREATE A FILE (C:\GPS\723TEMP.TXT) WHERE columns 1-3 are: inlatcol, inloncol, inhcol: original values columns 4-6 are: in2latcol, in2loncol, in2hcol: converted values rem Initialize GeoConv-parameters call geocoini.bat fvalue geoconv.infile=c:\gps\723incrd.txt rem input-parameters must agree with the input-file c:\gps\723incrd.txt fvalue geoconv.inlatcol=1 fvalue geoconv.inloncol=2 fvalue geoconv.inhcol=3 fvalue geoconv.inform=crdlist fvalue geoconv.insep=, fvalue geoconv.incrdtype=deg fvalue geoconv.indatum=WGS84 rem replace the output-datum KKJ with yor datum containing the seven rem parameters fvalue geoconv.outdatum=KKJ fvalue geoconv.outform=crdlist fvalue geoconv.outcrdtype=deg fvalue geoconv.outlineform=@item,1@,@item,2@,@item,3@,@lat,.9@,@lon,.9@,@h,3.9@ fvalue geoconv.outfile=c:\gps\723temp.txt geoconv >c:\gps\723.log rem show temporary file show c:\gps\723temp.txt REM PHASE 2: CALCULATE DIFFERENCES BETWEEN ORIGINAL AND CONVERTED REM COORDINATES rem Initialize GeoConv-parameters call geocoini.bat rem input-parameters fvalue geoconv.infile=c:\gps\723temp.txt fvalue geoconv.inlatcol=1 fvalue geoconv.inloncol=2 fvalue geoconv.inhcol=3 fvalue geoconv.in2latcol=4 fvalue geoconv.in2loncol=5 fvalue geoconv.in2hcol=6 fvalue geoconv.inform=crdlist fvalue geoconv.incrdtype=deg rem indatum has to be WGS84 here fvalue geoconv.indatum=WGS84 rem output-parameters fvalue geoconv.outform=crdlist fvalue geoconv.outcrdtype=deg fvalue geoconv.outlineform=@lat,.6@,@lon,.6@,@h,3.3@,@in2dist,.3@,@in2dcx,.6@,@in2dcy,.6@,@in2dcz,.6@ rem footer: rem - output-datum rem - maximum distance and avegare distance rem - average differences in 3d-cartesian coordinates fvalue geoconv.outfooterform=@outdatum@, @maxin2dist,.3@, @avein2dist,.3@,@avein2dcx,.6@,@avein2dcy,.6@,@avein2dcz,.6@ rem this gives total correction rem ellipsoid must be the same as in outdatum in phase 1 rem All other datum parameters MUST BE 0 fvalue datum.723temp=-1,HAYFORD,0,0,0,0,0,0,0.0 fvalue geoconv.outdatum=723temp fvalue geoconv.outfile=c:\gps\723out.txt geoconv >>c:\gps\723.log rem show output-file show [[geoconv.outfile]] rem show log-file of the entire run rem if everything is OK, log-file contains only the names of the rem input-files show c:\gps\723.log