Pyproj – Differences in Transformations Between Versions 2.6.1post1 and 3.0.0

coordinate systemcoordinatespyprojpython

I've got the following Python Script:

from pyproj import Transformer, transform

transformer = Transformer.from_crs(31468, 25832, always_xy=True)

x_coords = 4359995
y_coords = 5295525

transformer.transform(x_coords, y_coords)

With pyproj 2.6.1.post1 I get these coordinates:

(584665.8977184547, 5292775.704050368)

With pyproj 3.0.0 or 3.2.0 I get these coordinates:

 (584665.4771803176, 5292775.48134032)

Can someone explain the difference? Do you get the same results?

Best Answer

Test with gdaltranslate and Proj version Rel. 6.3.2, May 1st, 2020

gdaltransform -s_srs epsg:31468 -t_srs epsg:25832
4359995 5295525
584665.897718455 5292775.70405037 0

Test with Proj 7.2.0

gdaltransform -s_srs epsg:31468 -t_srs epsg:25832
4359995 5295525
584665.477180318 5292775.48134032 0

Your numbers look alike. Obviously newer Proj version gives slightly different result that is hopefully more accurate.

Projinfo shows how the conversion is done:

projinfo -s epsg:31468 -t epsg:25832
Candidate operations found: 2
Note: using '--spatial-test intersects' would bring more results (6)
-------------------------------------
Operation No. 1:

unknown id, Inverse of 3-degree Gauss-Kruger zone 4 + DHDN to ETRS89 (8) + UTM zone 32N, 0.9 m, Germany - onshore

PROJ string:
+proj=pipeline +step +proj=axisswap +order=2,1 +step +inv +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +step +proj=hgridshift +grids=BETA2007.gsb +step +proj=utm +zone=32 +ellps=GRS80

This transformation seems to utilize the gridshift file "BETA2007.gsb".