<div dir="ltr"><div>To answer my own question (so next time I run into it I can find my answer :) ) - this specific transform doesn't rely on the geoidgrids parameter, as it is an xy transform only, and geoidgrids is for z. So quite probably what happens here is that the older version just tried to load the nonexistant file but didn't actually used it afterwards, and the new one doesn't even try to load it as it can decide it is unnecessary.</div><div><br></div><div>Istvan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 15, 2023 at 5:07 PM Szekeres István <<a href="mailto:szekeres@iii.hu">szekeres@iii.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Hi,</div><div><br></div><div>could you pls help deciding if this is a bug or feature?</div><div><br></div><div>I want to move a piece of code from Python 3.10 to 3.11 and updating the pyproj version made a unit test that tests for a failure not to work anymore, as what was a failure before no longer seems to be it.</div><div><br></div><div>The code - note that geoidgrids egm96_25.gtx is intentionally wrong and doesn't exist:<br></div><div><br></div><div><span style="font-family:monospace">from pyproj import Transformer,CRS</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">crs_current = CRS.from_proj4('+proj=tmerc +lat_0=51 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_25.gtx +vunits=m +no_defs')</span></div><div><span style="font-family:monospace">crs_4326 = CRS.from_epsg(4326)</span></div><div><span style="font-family:monospace">transformer = Transformer.from_crs(crs_current, crs_4326, always_xy=True)</span></div><div><br></div><div>When running this piece of code in Python 3.10 + pyproj 3.3.1 (=proj 8.2.0) results in an exception:</div><div><br></div><span style="font-family:monospace">>>> transformer = Transformer.from_crs(crs_current, crs_4326, always_xy=True)<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "/home/istvan/.local/lib/python3.10/site-packages/pyproj/transformer.py", line 573, in from_crs<br>    return Transformer(<br>  File "/home/istvan/.local/lib/python3.10/site-packages/pyproj/transformer.py", line 310, in __init__<br>    self._local.transformer = transformer_maker()<br>  File "/home/istvan/.local/lib/python3.10/site-packages/pyproj/transformer.py", line 97, in __call__<br>    return _Transformer.from_crs(<br>  File "pyproj/_transformer.pyx", line 1003, in pyproj._transformer._Transformer.from_crs<br>  File "pyproj/_transformer.pyx", line 1073, in pyproj._transformer._Transformer._init_from_crs<br>  File "pyproj/_transformer.pyx", line 809, in pyproj._transformer._Transformer._initialize_from_projobj<br></span><div><span style="font-family:monospace">pyproj.exceptions.ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: proj=vgridshift (File not found or invalid))</span></div><div><br></div><div>Which is IMHO the right behaviour, as the given geoidgrids is wrong.</div><div><br></div><div>But when running with Python 3.11 and pyproj 3.4.1 (=proj 9.1.0) this doesn't cause any exception and the returned transformer is happily transforming coordinates.</div><div><br></div><div>Is this a bug or a feature? Shall I create a new issue in the tracker to "restore" the old behavior - to make a wrong input result in an error?</div><div><br></div><div>Thanks,</div><div>Istvan<br></div></div>
</blockquote></div>