0%

PROJ 坐标转换的几个例子

PROJ 转ITRF地心坐标到经纬度

1
2
$ echo 4097216.6805  4429119.0287 -2065771.3676 0 | cct -I +proj=cart +ellps=GRS80
47.2292116930 -19.0183060232 1552.9924 0.0000

PROJ 转经纬度到ITRF地心坐标

1
2
$ echo 47.2292116930  -19.0183060232     1552.9924 0 | cct +proj=cart +ellps=GRS80
4097216.6805 4429119.0287 -2065771.3676 0.0000

文件的批量转换

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 $ cat points_xyz.dat | head
2919786.0 -5383745.0 1774604.0
4097216.6805 4429119.0287 -2065771.3676
6347491.3770 -22944.8191 622823.1488
4913652.948 3945922.493 995383.145
+2765120.9 -4449250.25 -3626405.6
-3530185.489 4118797.337 3344036.931
4696990.000 723994.000 4239678.000
-2341332.8840 -3539049.5090 4745791.3600
918129.40 -4346071.20 4561977.80
-4052051.767 4212836.215 -2545106.027

$ cat points_xyz.dat | cct -I +proj=cart +ellps=GRS80 | head
-61.5275339092 16.2622989639 -25.6724 inf
47.2292116930 -19.0183060232 1552.9924 inf
-0.2071110447 5.6414771807 83.4568 inf
38.7663016596 9.0351340011 2439.1542 inf
-58.1398674816 -34.8737126913 42.0708 inf
130.5995927060 31.8240613970 314.6402 inf
8.7626079453 41.9274508625 98.7752 inf
-123.4874696602 48.3897817140 31.7442 inf
-78.0713675911 45.9558003990 200.8294 inf
133.8855132190 -23.6701238732 603.3581 inf

注意到第四列是时间信息,如果文件中缺少,则转换结果中提示inf