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

transform returns (inf, inf) #418

Closed
rubenhelsloot opened this issue Aug 29, 2019 · 2 comments
Closed

transform returns (inf, inf) #418

rubenhelsloot opened this issue Aug 29, 2019 · 2 comments
Labels

Comments

@rubenhelsloot
Copy link

rubenhelsloot commented Aug 29, 2019

Code Sample

from pyproj import Transformer
transform = Transformer.from_proj(4326, 28992).transform
print(transform(167.4859809375065, 57.1473954556774)) # '(inf inf)'

Problem description

The given code returns infinity for both values, even though the following PostGIS code does work:

SELECT st_astext(st_transform(st_setsrid(st_makepoint(167.4859809375065, 57.1473954556774), 4326), 28992))
-- `POINT(1732254.57956239 9227210.3008903)`

It's the same for target SRID 4324 or 4322, all of which should be able to cover the entire globe. Can someone please explain whether I'm doing something wrong or if this is a bug? Thanks in advance!

Environment Information

Output from: python -c "import pyproj; pyproj.show_versions()"

System:
    python: 3.7.3 (default, Jun 19 2019, 07:38:49)  [Clang 10.0.1 (clang-1001.0.46.4)]
executable: /Users/rubenhelsloot/dashboard/.venv/bin/python
   machine: Darwin-18.7.0-x86_64-i386-64bit

PROJ:
      PROJ: 6.1.0
  data dir: /Users/rubenhelsloot/dashboard/.venv/lib/python3.7/site-packages/pyproj/proj_dir/share/proj

Python deps:
pyproj: 2.2.1
pip: 19.2.1
setuptools: 41.0.1
Cython: None
aenum: None

Installation method

  • Installed with pipenv
@rubenhelsloot
Copy link
Author

I see now that print(transform(57.1473954556774, 167.4859809375065)) does work, so I think I have to interchange latitude and longitude compared to PostGIS - where longitude comes before latitude

@snowman2
Copy link
Member

You can also use the always_xy option when creating the transformer.

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

2 participants