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

Bug: pyproj.exceptions.CRSError for current version of pyproj (2.1.3) #16

Open
JSchiefelbein opened this issue May 14, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@JSchiefelbein
Copy link

Calling example_osm.py with pyproj version 2.1.3 leads to the following error:

Traceback (most recent call last):
  File "/Users/PycharmProjects/uesgraphs/uesgraphs/examples/example_osm.py", line 202, in <module>
    main()
  File "/Users/PycharmProjects/uesgraphs/uesgraphs/examples/example_osm.py", line 26, in main
    example_district = osm_demo_three_buildings()
  File "/Users/PycharmProjects/uesgraphs/uesgraphs/examples/example_osm.py", line 64, in osm_demo_three_buildings
    check_boundary=False)
  File "/Users/PycharmProjects/uesgraphs/uesgraphs/uesgraph.py", line 1975, in from_osm
    curr_way.bounds[3])
  File "/Users/PycharmProjects/uesgraphs/uesgraphs/uesgraph.py", line 1799, in latlon2abs
    lat2=lat2)),
  File "/Users/anaconda3/lib/python3.7/site-packages/pyproj/proj.py", line 295, in __init__
    self.crs = CRS.from_user_input(projparams if projparams is not None else kwargs)
  File "/Users/anaconda3/lib/python3.7/site-packages/pyproj/crs.py", line 224, in from_user_input
    return cls(**value)
  File "/Users/anaconda3/lib/python3.7/site-packages/pyproj/crs.py", line 146, in __init__
    super(CRS, self).__init__(projstring)
  File "pyproj/_crs.pyx", line 317, in pyproj._crs._CRS.__init__
pyproj.exceptions.CRSError: Invalid projection: +proj=aea +lat1=50.7635284 +lat2=50.7637093 +type=crs: (Internal Proj Error: proj_create: Error -21: conic lat_1 = -lat_2)

Error caused by function latlon2abs() in uesgraph.py:

pyproj.Proj(
                        proj='aea',
                        lat1=lat1,
                        lat2=lat2)

Currently only tested with Mac OS 10.14.4.
Seems to work fine for pyproj version 1.9.6.

@MichaMans
Copy link
Contributor

@JSchiefelbein Thanks for raising this. What is your suggestion to solve this?

@nfgalas
Copy link

nfgalas commented Sep 20, 2019

This can be resolved by changing def latlon2abs(geometry, lat_1, lat_2):
and pyproj.Proj(
proj='aea',
lat_1=lat_1,
lat_2=lat_2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants