Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformerGroup does not handle cases where both the allow_superseded and always_xy user arguments is used #1464

Open
phaarnes opened this issue Dec 9, 2024 · 1 comment
Labels

Comments

@phaarnes
Copy link

phaarnes commented Dec 9, 2024

Example code

Ex. 1 TransformerGroup fails to list up available transformations when specifying both always_xy and allow_superseded

from pyproj.transformer import TransformerGroup
TransformerGroup("EPSG:4230", "EPSG:4326", allow_superseded=True, always_xy=True).transformers

Outputs:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyproj/transformer.py", line 207, in __init__
    super().__init__(
  File "pyproj/_transformer.pyx", line 241, in pyproj._transformer._TransformerGroup.__init__
  File "pyproj/_transformer.pyx", line 602, in pyproj._transformer._Transformer._from_pj
  File "pyproj/_transformer.pyx", line 653, in pyproj._transformer._Transformer._init_from_crs
  File "pyproj/_transformer.pyx", line 359, in pyproj._transformer._Transformer._initialize_from_projobj
pyproj.exceptions.ProjError: Input is not a transformation.

Ex.2 TransformerGroup should return 36 available transformations when allow_superseded not defined

ct_lst = TransformerGroup("EPSG:4230", "EPSG:4326").transformers
print(len(ct_lst))

Outputs:

36

Ex.3 TransformerGroup should return 37 available transformations when allow_superseded is set to True

ct_lst = TransformerGroup("EPSG:4230", "EPSG:4326", allow_superseded=True).transformers
print(len(ct_lst))

Outputs:

37

ct_lst = TransformerGroup("EPSG:4230", "EPSG:4326", allow_superseded=True).transformers
print(len(ct_lst))

Problem description

TransformerGroup fails to a create a list of with all available transformation objects when the user set both always_xy and allow_superseded equals True.

Environment Information

pyproj version 3.6.1
python 3.11

Installation method

pip wheel

@phaarnes phaarnes added the bug label Dec 9, 2024
@phaarnes
Copy link
Author

phaarnes commented Dec 9, 2024

An issue is created in Proj GitHub repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant