-
Notifications
You must be signed in to change notification settings - Fork 213
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
Inverse projection gives different results for pyproj 1.9.6 and 2.4.0 #470
Labels
Comments
Hmmm, seems like something to look into. The output of
|
This gives the proper output: >>> from pyproj import CRS, Transformer
>>> cc = CRS("+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
>>> trans = Transformer.from_crs(cc, cc.geodetic_crs, always_xy=True)
>>> trans.transform(3640945.346538976, -9059984.893837836)
(32.70716853439809, -62.83532198512574)
>>> trans = Transformer.from_crs(cc.geodetic_crs, cc, always_xy=True)
>>> trans.transform(3640945.346538976, -9059984.893837836, direction="inverse")
(32.70716853439809, -62.83532198512574) |
@rouault has confirmed the current behavior is correct and gave a nice explanation here: OSGeo/PROJ#1699 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
This python code is refered as
./pypro_bug.py
in the descrption of issue.Problem description
pyproj
gives different results across two versions of pyproj (1.9.6 and 2.4.0).Please see this image and following commands for more details.conda create --quiet --yes --channel conda-forge --name kidmenot python=3.6 pyproj=1.9.6 conda activate kidmenot # content of ./pypro_bug.py is detailed above ./pypro_bug.py conda install --yes -q pyproj=2.4.0 ./pypro_bug.py
Expected Output
I expected the projected long, lat to be same with pyproj 1.9.6 or 2.4.0.
Environment Information
python -m pyproj -v
pyproj info:
pyproj: 2.4.0
PROJ: 6.2.0
data dir: /Users/suneeta.mall/miniconda3/envs/kidmenot/lib/python3.6/site-packages/pyproj/proj_dir/share/proj
System:
python: 3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:07:37) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
executable: /Users/suneeta.mall/miniconda3/envs/kidmenot/bin/python
machine: Darwin-19.0.0-x86_64-i386-64bit
Python deps:
pip: 19.3.1
setuptools: 41.4.0
Cython: None
python -c "import pyproj; print(pyproj.__version__)"
)python -c "import pyproj; print(pyproj.proj_version_str)"
)python -c "import pyproj; print(pyproj.datadir.get_data_dir())"
)python -c "import sys; print(sys.version.replace('\n', ' '))"
)python -c "import platform; print(platform.platform())"
)$python -c "import pyproj; print(pyproj.version)"
1.9.6
$python -c "import pyproj; print(pyproj.proj_version_str)"
4.9.3
$python -c "import pyproj; print(pyproj.datadir.get_data_dir())"
/Users/suneeta.mall/miniconda3/envs/kidmenot/share/proj
$python -c "import sys; print(sys.version.replace('\n', ' '))"
3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:07:37) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
$python -c "import platform; print(platform.platform())"
Darwin-19.0.0-x86_64-i386-64bit
Installation method
conda
Conda environment information (if you installed with conda):
Environment (
conda list
):Details about
conda
and system (conda info
):The text was updated successfully, but these errors were encountered: