File: test_cct.yaml

package info (click to toggle)
proj 9.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,620 kB
  • sloc: sh: 219,086; cpp: 173,769; sql: 85,586; python: 8,577; ansic: 6,274; yacc: 1,349; javascript: 228; makefile: 33
file content (177 lines) | stat: -rw-r--r-- 7,831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
exe: cct
tests:

- comment: Test version argument
  args: --version
  sub: ["cct(_d)?(\\.exe)?: Rel.*", "cct: Rel"]
  stdout: "cct: Rel"
  exitcode: 0

- comment: Test help argument
  args: -h
  grep: "Usage: "
  sub: ["cct(_d)?(\\.exe)?", "cct"]
  stdout: "Usage: cct [-options]... [+operator_specs]... infile..."
  exitcode: 0

- args: -d 8 +proj=merc +R=1
  in: 90 45 0
  out: "   1.57079633     0.88137359    0.00000000           inf"
# tests without specifying the number of decimals (by default: 10 for radians and degrees, 4 for meters)
- args: -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad
  in: 0.5 2
  out: "  0.5000000000    2.0000000000        0.0000        0.0000"
- args: -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg
  in: 0.5 2
  out: "  0.5000000000    2.0000000000        0.0000        0.0000"
- args: -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km
  in: 0.5 2
  out: "       0.0005         0.0020        0.0000        0.0000"
# tests for which the number of decimals has been specified (-d 6)
- args: -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad
  in: 0.5 2
  out: "      0.500000        2.000000      0.000000        0.0000"
- args: -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg
  in: 0.5 2
  out: "      0.500000        2.000000      0.000000        0.0000"
- args: -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km
  in: 0.5 2
  out: "     0.000500       0.002000      0.000000        0.0000"
- comment: Test cct with object code initialization
  args: EPSG:8366
  in: 3541657.3778 948984.2343 5201383.5231 2020.5
  out: " 3541657.9112    948983.7503  5201383.2482     2020.5000"
- comment: Test cct with object that is not a CRS
  args:
  - GEOGCRS["WGS 84",DATUM["World Geodetic System 1984 (G2139)",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic
    longitude (Lon)",east,ANGLEUNIT["degree",0.0174532925199433]]]
  in: 0 0 0
  sub: ["(_d)?\\.exe", ""]
  stderr: "cct: Input object is not a coordinate operation, but a CRS."
  exitcode: 1
- comment: Test cct with object name initialization
  args:
  - ITRF2014 to ETRF2014 (1)
  in: 3541657.3778 948984.2343 5201383.5231 2020.5
  out: " 3541657.9112    948983.7503  5201383.2482     2020.5000"
- comment: Test cct with object code initialization and file input
  file:
  - name: a
    content: 3541657.3778 948984.2343 5201383.5231 2020.5
  - name: b
    content: 3541658.0000 948985.0000 5201384.0000 2020.5
  args: "EPSG:8366 a b"
  out: |2
     3541657.9112    948983.7503  5201383.2482     2020.5000
     3541658.5334    948984.5160  5201383.7251     2020.5000
- comment: Test cct with WKT in a file
  file:
  - name: in.wkt
    content: |
      COORDINATEOPERATION["ITRF2014 to ETRF2014 (1)",
          VERSION["EUREF-Eur"],
          SOURCECRS[
              GEODCRS["ITRF2014",
                  DYNAMIC[
                      FRAMEEPOCH[2010]],
                  DATUM["International Terrestrial Reference Frame 2014",
                      ELLIPSOID["GRS 1980",6378137,298.257222101,
                          LENGTHUNIT["metre",1]]],
                  PRIMEM["Greenwich",0,
                      ANGLEUNIT["degree",0.0174532925199433]],
                  CS[Cartesian,3],
                      AXIS["(X)",geocentricX,
                          ORDER[1],
                          LENGTHUNIT["metre",1]],
                      AXIS["(Y)",geocentricY,
                          ORDER[2],
                          LENGTHUNIT["metre",1]],
                      AXIS["(Z)",geocentricZ,
                          ORDER[3],
                          LENGTHUNIT["metre",1]],
                  ID["EPSG",7789]]],
          TARGETCRS[
              GEODCRS["ETRF2014",
                  DATUM["European Terrestrial Reference Frame 2014",
                      ELLIPSOID["GRS 1980",6378137,298.257222101,
                          LENGTHUNIT["metre",1]]],
                  PRIMEM["Greenwich",0,
                      ANGLEUNIT["degree",0.0174532925199433]],
                  CS[Cartesian,3],
                      AXIS["(X)",geocentricX,
                          ORDER[1],
                          LENGTHUNIT["metre",1]],
                      AXIS["(Y)",geocentricY,
                          ORDER[2],
                          LENGTHUNIT["metre",1]],
                      AXIS["(Z)",geocentricZ,
                          ORDER[3],
                          LENGTHUNIT["metre",1]],
                  ID["EPSG",8401]]],
          METHOD["Time-dependent Position Vector tfm (geocentric)",
              ID["EPSG",1053]],
          PARAMETER["X-axis translation",0,
              LENGTHUNIT["millimetre",0.001],
              ID["EPSG",8605]],
          PARAMETER["Y-axis translation",0,
              LENGTHUNIT["millimetre",0.001],
              ID["EPSG",8606]],
          PARAMETER["Z-axis translation",0,
              LENGTHUNIT["millimetre",0.001],
              ID["EPSG",8607]],
          PARAMETER["X-axis rotation",0,
              ANGLEUNIT["milliarc-second",4.84813681109536E-09],
              ID["EPSG",8608]],
          PARAMETER["Y-axis rotation",0,
              ANGLEUNIT["milliarc-second",4.84813681109536E-09],
              ID["EPSG",8609]],
          PARAMETER["Z-axis rotation",0,
              ANGLEUNIT["milliarc-second",4.84813681109536E-09],
              ID["EPSG",8610]],
          PARAMETER["Scale difference",0,
              SCALEUNIT["parts per billion",1E-09],
              ID["EPSG",8611]],
          PARAMETER["Rate of change of X-axis translation",0,
              LENGTHUNIT["millimetres per year",3.16887651727315E-11],
              ID["EPSG",1040]],
          PARAMETER["Rate of change of Y-axis translation",0,
              LENGTHUNIT["millimetres per year",3.16887651727315E-11],
              ID["EPSG",1041]],
          PARAMETER["Rate of change of Z-axis translation",0,
              LENGTHUNIT["millimetres per year",3.16887651727315E-11],
              ID["EPSG",1042]],
          PARAMETER["Rate of change of X-axis rotation",0.085,
              ANGLEUNIT["milliarc-seconds per year",1.53631468932076E-16],
              ID["EPSG",1043]],
          PARAMETER["Rate of change of Y-axis rotation",0.531,
              ANGLEUNIT["milliarc-seconds per year",1.53631468932076E-16],
              ID["EPSG",1044]],
          PARAMETER["Rate of change of Z-axis rotation",-0.77,
              ANGLEUNIT["milliarc-seconds per year",1.53631468932076E-16],
              ID["EPSG",1045]],
          PARAMETER["Rate of change of Scale difference",0,
              SCALEUNIT["parts per billion per year",3.16887651727315E-17],
              ID["EPSG",1046]],
          PARAMETER["Parameter reference epoch",1989,
              TIMEUNIT["year",31556925.445],
              ID["EPSG",1047]]]
  args: "@in.wkt"
  in: 3541657.3778 948984.2343 5201383.5231 2020.5
  out: " 3541657.9112    948983.7503  5201383.2482     2020.5000"
- comment: Test cct with input file with UTF-8 BOM marker
  file:
    name: input_file1_with_utf8_bom.txt
    content: "\uFEFF0 3 0\n"
  args: +proj=noop input_file1_with_utf8_bom.txt
  # no BOM with output
  out: "       0.0000         3.0000        0.0000           inf"
- comment: Test cct with non existing input file
  args: +proj=noop i_do_not_exist.txt
  stderr: "Cannot open file i_do_not_exist.txt"
  exitcode: 1
- comment: Test robustness to non-ASCII characters (cf https://github.com/OSGeo/PROJ/issues/4528 case 1)
  args: "-\uFF56"
  exitcode: 1
- comment: Test robustness to non-ASCII characters (cf https://github.com/OSGeo/PROJ/issues/4528 case 2)
  args: "--\xF3"
  exitcode: 1