p4m.xl (Creating mappings of 4 points or more)
Author: Hirohisa Mori / joshua@globalbase.org +
[Transrate]Reiko Inoue Bendtsen c/o Suzaku Translations /
(http://www.suzaku-translations.com/) +
PROTOTYPE
xl p4m.xl / [p4m-file]
ARGUMENTS
[p4m-file] Mapping file containing only point-map and meta data
Option
-
reverse= none/src/dest The default is none .
Support from ver.B.b16.05 and later.
ENVIRONMENT
Agent xl [UNDEF REF (xl)], Agent netmapper [UNDEF REF (netmapper)]
EXPLANATION
In mappings involving 4or more corresponding points, it is not possible to match the coordinates via linear transformation. For this reason, this command uses a complementary method, where the entire map region is divided into multiple triangular areas ( so-called TINs) and a different linear transformation is applied inside each TIN. Moreover, it is necesary to specify an approximate linear transformation for infinite distances so that a transformation can be applied to points placed at infinity in the coordinate systems. Although it is possible to specify these parameters and create a mapping file manually, it is usually easier to generate the mapping file automatically by specifying corresponding points and running the p4m.xl script.
In LANDSCAPE ver.B.b16.05 and later, a new reverse option has been added. If the axis directions of the mapping source and mapping destination are different, the reverse option is required. The reverse option is used to specify a mathematical coordinate system ( x-axis direction from left to right, y-axis direction up) relative to a computer coordinate system ( x-axis direction from left to right, y-axis direction down). For example, if the mapping source is a mathematical coordinate system, specify reverse=src. If the mapping destination is a mathematical coordinate system, specify reverse=dest. If both the mapping source and destination are mathematical coordinate systems, specify reverse=none.
First, create a file with the extension p4m. Basically, any extension except for map can be used. The structure of a p4m file is the same as that of a map file and contains point-map and meta data only. The first 3points can be considered as a map file, and the 4thpoint and onward can be considered as appended point-map data. Thus, if you already have a mapping file where a mapping of up to 3points has been specified, and you consider adding a 4thpoint to it, you can simply add the 4thpoint and rename the file extension to .p4m to create a p4m file. The example below shows the contents of a p4m file for a single system ( Kyushu).
<?xml version="1.0" encoding="EUC-JP"?>
<map>
<meta>
<file type="xl"/>
<src>
xlp://isjhp2.nichibun.ac.jp:8080/kokudo/coord/01.crd
</src>
<dest>
xlp://isjhp2.nichibun.ac.jp:8080/kokudo20000/coord/00.crd
</dest>
<dp>
181
</dp>
</meta>
<point-map>
b1
<list>
6577.435059m
30896.992188m
</list>
<list>
146482.000000m
1294111.625000m
</list>
</point-map>
<point-map>
b2
<list>
-16864.001953m
34593.703125m
</list>
<list>
149568.734375m
1315266.750000m
</list>
</point-map>
<point-map>
b3
<list>
-20587.638672m
81065.656250m
</list>
<list>
189254.359375m
1318867.375000m
</list>
</point-map>
<point-map>
b4
<list>
3998.532959m
12131.631836m
</list>
<list>
130398.726563m
1296403.500000m
</list>
</point-map>
<point-map>
b5
<list>
-38258.191406m
24350.640625m
</list>
<list>
140765.75000m
1334532.000000m
</list>
</point-map>
<point-map>
b6
<list>
-15451.980469m
56954.250000m
</list>
<list>
168696.531250m
1314098.375000m
</list>
</point-map>
</map>
Now save this contents in a file called and run the following script.
% xl p4m.xl - - / 01.p4m
Running the script generates the file, with the same name as the original except that the extension is changed to .map. However, this new file is a distributable mapping file in which TIN and infinite distance linear transformations are specified. The file contains the following.
<map>
<meta>
<file type="xl"/>
<src>
xlp://isjhp2.nichibun.ac.jp:8080/kokudo/coord/01.crd
</src>
<dest>
xlp://isjhp2.nichibun.ac.jp:8080/kokudo20000/coord/00.crd
</dest>
<dp>
181
</dp>
</meta>
<horizontal-affen>
<List>
<List>
0.002363
0.854563
</List>
<List>
-0.901667
0.004435
</List>
</List>
<List>
120044.569714
1299925.616167
</List>
</horizontal-affen>
<point-map>
^"1"
<list>
-127929.444336
-125736.416992
</list>
<list>
12292.601562
1414717.750000
</list>
</point-map>
<point-map>
^"2"
<list>
-38258.191406m
24350.640625m
</list>
<list>
140765.750000m
1334532.000000m
</list>
</point-map>
<point-map>
^"3"
<list>
-127929.444336
218933.705078
</list>
<list>
306835.000000
1416246.250000
</list>
</point-map>
<triangle-map>
^"1"
^"2"
^"3"
</triangle-map>
<triangle-map>
^"2"
^"3"
^"1"
</triangle-map>
<triangle-map>
^"3"
^"2"
^"1"
</triangle-map>
<point-map>
^"4"
<list>
6577.435059m
30896.992188m
</list>
<list>
146482.000000m
1294111.625000m
</list>
</point-map>
<point-map>
^"5"
<list>
96248.687988
218933.705078
</list>
<list>
307364.656250
1214112.375000
</list>
</point-map>
<point-map>
^"6"
<list>
96248.687988
-125736.416992
</list>
<list>
12822.257812
1212583.750000
</list>
</point-map>
<triangle-map>
^"4"
^"5"
^"6"
</triangle-map>
<triangle-map>
^"6"
^"4"
^"5"
</triangle-map>
<triangle-map>
^"5"
^"4"
^"6"
</triangle-map>
<point-map>
^"7"
<list>
3998.532959m
12131.631836m
</list>
<list>
130398.726563m
1296403.500000m
</list>
</point-map>
<triangle-map>
^"1"
^"7"
^"6"
</triangle-map>
<triangle-map>
^"7"
^"6"
^"1"
</triangle-map>
<triangle-map>
^"6"
^"7"
^"1"
</triangle-map>
<point-map>
^"8"
<list>
-20587.638672m
81065.656250m
</list>
<list>
189254.359375m
1318867.375000m
</list>
</point-map>
<triangle-map>
^"5"
^"8"
^"3"
</triangle-map>
<triangle-map>
^"3"
^"8"
^"5"
</triangle-map>
<triangle-map>
^"8"
^"3"
^"5"
</triangle-map>
<triangle-map>
^"2"
^"8"
^"3"
</triangle-map>
<triangle-map>
^"3"
^"2"
^"8"
</triangle-map>
<triangle-map>
^"5"
^"8"
^"4"
</triangle-map>
<triangle-map>
^"8"
^"4"
^"5"
</triangle-map>
<triangle-map>
^"1"
^"2"
^"7"
</triangle-map>
<triangle-map>
^"2"
^"7"
^"1"
</triangle-map>
<triangle-map>
^"7"
^"4"
^"6"
</triangle-map>
<triangle-map>
^"6"
^"7"
^"4"
</triangle-map>
<point-map>
^"9"
<list>
-15451.980469m
56954.250000m
</list>
<list>
168696.531250m
1314098.375000m
</list>
</point-map>
<triangle-map>
^"9"
^"2"
^"8"
</triangle-map>
<triangle-map>
^"9"
^"8"
^"4"
</triangle-map>
<point-map>
^"10"
<list>
-16864.001953m
34593.703125m
</list>
<list>
149568.734375m
1315266.750000m
</list>
</point-map>
<triangle-map>
^"2"
^"7"
^"10"
</triangle-map>
<triangle-map>
^"9"
^"2"
^"10"
</triangle-map>
<triangle-map>
^"9"
^"10"
^"4"
</triangle-map>
<triangle-map>
^"7"
^"10"
^"4"
</triangle-map>
</map>
Once this file is recognized by the server, the mapping is completed.
% xl makefile.xl - -
[UP]
Go To Page Top
RETURN VALUE
None
ERRORS
REFERENCE
BUGS
[UP]
Go To Page Top