[PROJ] transformations with epoch
Javier Jimenez Shaw
j1 at jimenezshaw.com
Sat Mar 14 15:53:06 PDT 2026
Hi
I have been playing with epochs today. Maybe I am understanding something
wrongly, but the outputs are very strange.
My deductions are:
- the 4th dimension (v_4) from the input is just copied into the output of
cs2cs. Independently of epoch flags.
- if --s_epoch or --t_epoch are set, the input v_4 is ignored (but still
printed in the output)
- if only --s_epoch or --t_epoch is set, v_4 is set before and after the
transformation to that value
- if both are set, v_4 is set to s_epoch before transforming, and to
t_epoch after. So in this case t_epoch only works to tag the output
time,... but it is not displayed in cs2cs (it is in the C function)
Is that correct? Why is t_epoch overwriting the input time/epoch? Why is
s_epoch setting the output time/epoch?
In addition, cs2cs is apparently not printing the modified output epoch.
This is not what C function does.
Here are some transformations using the input epoch in the coordinates and
the --s_epoch and --t_epoch
echo 40 0 0 | ./cs2cs ITRF90 ITRF2014 -d 9
40.000000788 -0.000000207 0.009684166
echo 40 0 0 foo bar | ./cs2cs ITRF90 ITRF2014 -d 9
40.000000788 -0.000000207 0.009684166 foo bar
echo 40 0 0 2010 | ./cs2cs ITRF90 ITRF2014 -d 9
40.000000788 -0.000000207 0.009684166 2010
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9
40.000000087 -0.000000216 -0.028724159 1980
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9 --s_epoch 2000
40.000000555 -0.000000210 -0.003118609 1980
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9 --s_epoch 2010
40.000000788 -0.000000207 0.009684166 1980
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9 --s_epoch 2010 --t_epoch
2030
40.000000788 -0.000000207 0.009684166 1980
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9 --s_epoch 2000 --t_epoch
2030
40.000000555 -0.000000210 -0.003118609 1980
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9 --t_epoch 2010
40.000000788 -0.000000207 0.009684166 1980
echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014 -d 9 --t_epoch 2030
40.000001256 -0.000000201 0.035289716 1980
The pipelines for some cases are
without setting --s_epoch or --t_epoch
+proj=pipeline
+step +proj=axisswap +order=2,1
+step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m
+step +proj=cart +ellps=GRS80
+step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0
+rz=-0.00026
+s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0
+drz=-2e-05
+ds=-0.00012 +t_epoch=2010 +convention=position_vector
+step +inv +proj=cart +ellps=GRS80
+step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m
+step +proj=axisswap +order=2,1
setting --s_epoch to 2000
+proj=pipeline
+step +proj=set +v_4=2000
+step +proj=axisswap +order=2,1
+step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m
+step +proj=cart +ellps=GRS80
+step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0
+rz=-0.00026
+s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0
+drz=-2e-05
+ds=-0.00012 +t_epoch=2010 +convention=position_vector
+step +inv +proj=cart +ellps=GRS80
+step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m
+step +proj=axisswap +order=2,1
+step +proj=set +v_4=2000
setting --t_epoch to 2030
+proj=pipeline
+step +proj=set +v_4=2030
+step +proj=axisswap +order=2,1
+step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m
+step +proj=cart +ellps=GRS80
+step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0
+rz=-0.00026
+s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0
+drz=-2e-05
+ds=-0.00012 +t_epoch=2010 +convention=position_vector
+step +inv +proj=cart +ellps=GRS80
+step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m
+step +proj=axisswap +order=2,1
+step +proj=set +v_4=2030
setting --s_epoch to 2000 and --t_epoch to 2030
+proj=pipeline
+step +proj=set +v_4=2000
+step +proj=axisswap +order=2,1
+step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m
+step +proj=cart +ellps=GRS80
+step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0
+rz=-0.00026
+s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0
+drz=-2e-05
+ds=-0.00012 +t_epoch=2010 +convention=position_vector
+step +inv +proj=cart +ellps=GRS80
+step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m
+step +proj=axisswap +order=2,1
+step +proj=set +v_4=2030
PS https://jjimenezshaw.github.io/wasm-proj/transform.html is in this
case probably showing better the output of the C function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20260314/eccf38bb/attachment.htm>
More information about the PROJ
mailing list