pyproj4 / pyproj

Python interface to PROJ (cartographic projections and coordinate transformations library)
https://pyproj4.github.io/pyproj
MIT License
1.05k stars 212 forks source link

ESRI:102685 causes an error #1021

Closed sowdm closed 2 years ago

sowdm commented 2 years ago

Code Sample, a copy-pastable example if possible

from pyproj import CRS
crs = CRS.from_epsg(102685)

Problem description

Code fails with the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "[/home/matt/.local/share/virtualenvs/openpolicedata-xNuCOb40/lib/python3.8/site-packages/pyproj/crs/crs.py]()", line 370, in from_epsg
    return cls.from_user_input(_prepare_from_epsg(code))
  File "[/home/matt/.local/share/virtualenvs/openpolicedata-xNuCOb40/lib/python3.8/site-packages/pyproj/crs/crs.py]()", line 479, in from_user_input
    return cls(value, **kwargs)
  File "[/home/matt/.local/share/virtualenvs/openpolicedata-xNuCOb40/lib/python3.8/site-packages/pyproj/crs/crs.py]()", line 326, in __init__
    self._local.crs = _CRS(self.srs)
  File "pyproj[/_crs.pyx]()", line 2352, in pyproj._crs._CRS.__init__
pyproj.exceptions.CRSError: Invalid projection: epsg:102685: (Internal Proj Error: proj_create: crs not found)

Expected Output

Environment Information

System: python: 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] executable: /home/matt/.local/share/virtualenvs/openpolicedata-xNuCOb40/bin/python machine: Linux-5.4.0-91-generic-x86_64-with-glibc2.29

Python deps: certifi: 2021.10.08 pip: 21.3.1 setuptools: 58.3.0 Cython: None


 - pyproj version (`python -c "import pyproj; print(pyproj.__version__)"`):  '3.3.0'
 - PROJ version (`python -c "import pyproj; print(pyproj.proj_version_str)"`): '8.2.0'
 - PROJ data directory (`python -c "import pyproj; print(pyproj.datadir.get_data_dir())"`): '/home/matt/.local/share/virtualenvs/openpolicedata-xNuCOb40/lib/python3.8/site-packages/pyproj/proj_dir/share/proj'
 - Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`): '3.8.10 (default, Nov 26 2021, 20:14:08)  [GCC 9.3.0]'
 - Operation System Information (`python -c "import platform; print(platform.platform())"`): Linux-5.4.0-91-generic-x86_64-with-glibc2.29

#### Installation method
 - conda, pip wheel, from source, etc...: pip wheel
snowman2 commented 2 years ago

This should work:

from pyproj import CRS
crs = CRS.from_authority("ESRI", 102685)
# this works too
crs = CRS("ESRI:102685")
sowdm commented 2 years ago

That works. Thanks!